안녕하세요.

 

화면에 표시되는 Widget(Button, ImageView...) 의 position정보 알 수 없나요?

 

reference에는 보면  getWidtr(), getHeight()  혹은  getLeft(), getTop(), getBottom(), getRight() 로

크기와 위치 값을 읽어 올 수있다고 하는데

아무리 해도 항상 0 이 나옵니다.

 

-------------------------------------------------------------------------------------

<LinearLayout       xmlns:android="http://schemas.android.com/apk/res/android"
                           android:orientation="vertical"
                           android:layout_width="fill_parent"
                           android:layout_height="fill_parent" >

       
         <ImageView   android:id="@+id/imageView"
                              android:layout_height="wrap_content"
                              android:layout_width="wrap_content"
                              android:src="@drawable/icon" />
</LinearLayout>

-------------------------------------------------------------------------------------

        ImageView img = (ImageView) findViewById(R.id.imageView);

 

        Log.i( TAG , "( " + img.getLeft()  + " , " +  img.getTop()+ " ) || ( "

                                + img.getRight()+ " , " +  img.getBottom()+ " )");

-------------------------------------------------------------------------------------

 

 

이 정보 읽어오는 것을 onCreate(), onResum() 모두 해 보았지만 항상 0 이 나옵니다.

 

원래 못 읽어 오는 건가요? 아님 뭐가 잘 못 된건가요?

 

좀 알려 주세요..