Spinach菠菜

关注

Android中在OnCreate时获得控件高度

Spinach菠菜

关注

阅读 64

2022-08-16


ViewTreeObserver vto = mArrowUp.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
mArrowUp.getViewTreeObserver().removeGlobalOnLayoutListener(this);
Log.e("Width",Integer.toString(mArrowUp.getWidth()));



}
});



相关推荐

倚然君

解决Android Activity :: onCreate在Application.onCreate之前的具体操作步骤

倚然君 63 0 0

无聊到学习

android oncreate 执行

无聊到学习 41 0 0

非常帅气的昵称吧

android DialogFragment onCreate

非常帅气的昵称吧 22 0 0

Gascognya

android AppCompatActivity 没有oncreate方法

Gascognya 23 0 0

伽马星系

ScrollView中的控件高度充满父窗体

伽马星系 189 0 0

米小格儿

iframe中获得父页面的easyUi控件

米小格儿 70 0 0

Separes

Android 在程序中动态添加 View 布局或控件

Separes 112 0 0

潇湘落木life

在App中获得MainFrame指针

潇湘落木life 113 0 0

c一段旅程c

jQuery获取控件高度值

c一段旅程c 42 0 0

树下的老石头

在View中获得Doc指针

树下的老石头 117 0 0

精彩评论(0)

0 0 举报