Android custom dialog height -
i'm learning android dialogs , i'm confused determines height. if use xml dialog layout . . .
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <button android:id="@+id/abutton" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignparentright="true" android:layout_marginleft="10px" android:text="click me dismiss" /> <textview android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_toleftof="@id/abutton" android:text="click button: " /> <imageview android:id="@+id/an_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="42px" android:src="@drawable/screw50"> </imageview> />
i dialog . . .
but developer.android.com says that...
"wrap_content, means view wants big enough enclose content (plus padding)"
... why dialog higher needs be?
if replace layout height
android:layout_height="200px"
it makes short dialog don't want use explicit pixel heights (it's not practice). how make dialog big enough content?
you have height of textview fill_parent. possible this, combined height of relativelayout wrap_content pushing height maximum size? happens if change textview height wrap_content?
to add, the android sdk says children of relativelayout can not have dependency on layout, such align_parent_bottom. assume fill_parent dependency , breaking layout.
Comments
Post a Comment