Hi,

I create a custom view "MyExpandedView". The size of this view should
not be fixed, its size should be calculated at runtime. Shall I use
"View.measure()" and "View.onMeasure()"? Or other method? Thank for
your help!

Note this custome view is in a ViewGroup. My layout file is below:

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

    <com.my.MyExpandedView
            xmlns:android="http://schemas.android.com/apk/res/android";
            android:id="@+id/candidates"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_weight="1"
           />

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
          android:id="@+id/floating_container"
          android:orientation="horizontal"
          android:gravity="right"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content">

        <Button android:id="@+id/cancel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="OK"
            android:background="@drawable/btn_background"
            android:layout_gravity="center_horizontal"/>
        <Button android:id="@+id/prevPage"
            android:text="Cancel"
            android:background="@drawable/btn_background"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </LinearLayout>

</LinearLayout>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to