I am trying to design a custom dialog. The problem I met was..the background of the textview ,which is the body of the dialog can't change whenever the text get more line .. wrap_content didn't work ....
PS (there are there part , title , content, buttons ) ( title and content are two TextView with two image as background)
one line is fine
but when lines increased... they were eaten !!
if I use wrap_content ... it goes too big ! https://www.dropbox.com/s/in78b8gg0hfkfxh/toobig.png
here is the code of xml `
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
>
<LinearLayout
android:id="@+id/dialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="120dip"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dip"
android:orientation="vertical"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/title"
android:text="Title"
style="@style/TitleStyle"
android:gravity="bottom|center_horizontal"
android:paddingBottom="15dip"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="89dip"
android:background="@drawable/content"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="L\na\ny\no\nu\nt\n"
android:gravity="center"
style="@style/TextStyle"
android:paddingRight="20dip"
android:paddingLeft="20dip"
android:paddingTop="10dip"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="0dip"
android:paddingTop="0dip" >
<Button
android:id="@+id/dialog_button_cancel"
android:layout_width="0dip"
android:layout_height="51dip"
android:layout_weight="0.50"
style="@style/BtnStyle"
android:background="@drawable/btn_action"
android:src="@drawable/btn"
android:text="取消"
android:gravity="center"
/>
<Button
android:id="@+id/dialog_button_ok"
android:layout_width="0dip"
android:layout_height="51dip"
android:layout_weight="0.50"
android:background="@drawable/btn_action"
android:src="@drawable/btn"
android:layout_marginLeft="10dip"
style="@style/BtnStyle"
android:text="確定"
android:gravity="center"
/>
</LinearLayout>
</LinearLayout>
`