I am trying to make a custom dialog in Android. Everything works perfectly except that the height of the dialog is too big and it looks bad. I attached an image to see how it looks: http://i42.tinypic.com/14t1lp4.jpg
I only need the button part to show. Also, it would be nice if the white contour would dissapear as well.
This is my layout code:
<?xml version="1.0" encoding="utf-8"?>
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:gravity="center"
android:maxLines="4"
android:text="@string/app_name"
android:textColor="#ff000000" android:drawingCacheQuality="high" android:textSize="18dip"/>
<Button
android:id="@+id/dialogButton"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Button" android:background="@drawable/buttond" android:textColor="#ffffffff" android:textStyle="bold"/>
Any help is appreciated. Thanks
Put the following code in your Custom Dialog Box’s constructor or wherever you call
setContentView()–This will save lot of space from your dialog.
NOTE : Put the above code BEFORE
setContentView()