Hi,
I have a custom view in my application, which doesn't change it's size
the last time onMeasure is called on it. Can someone explain this to
me please?
My view is an extension of ImageView and it's parent is a
RelativeLayout.
This is part of my xml:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/root">
<view class="my.pacage.myActivity$MyNestedClas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:id="@+id/view"
android:layout_above="@+id/c_layout"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true">
</view>
...
...
</RelativeLayout>
this is my onMeasure Inplementation:
@Override
public void onMeasure(int w, int h){
int rw = (int) (MeasureSpec.getSize(h) * aspect);
int rh = MeasureSpec.getSize(h);
Log.d("ONMEASURE", ""+rw+" x "+rh);
setMeasuredDimension(rw, rh);
}
and this is my LogCat:
11-21 15:37:34.586: D/ONMEASURE(4751): 0 x 352
11-21 15:37:34.596: D/ONMEASURE(4751): 0 x 277
11-21 15:37:34.757: D/VIEW_HEIGHT(4751): 277
11-21 15:37:34.757: D/VIEW_WIDTH(4751): 0
11-21 15:37:34.997: D/ONMEASURE(4751): 625 x 352
11-21 15:37:35.007: D/VIEW_HEIGHT(4751): 277
11-21 15:37:35.007: D/VIEW_WIDTH(4751): 0
11-21 15:37:35.017: D/ONMEASURE(4751): 359 x 202
11-21 15:37:35.027: D/VIEW_HEIGHT(4751): 202
11-21 15:37:35.027: D/VIEW_WIDTH(4751): 625
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en