android - Adjusting height of a Custom layout in a dialog -
i have dialog custom layout, working fine, except there big empty spaces @ bottom cannot remove.
any suggestion how can remove empty space.
here code:
public dialog oncreatedialog() { final alertdialog.builder builder = new alertdialog.builder( this); // layout inflater layoutinflater inflater = getlayoutinflater(); // inflate , set layout dialog // pass null parent view because going in dialog layout builder.setview(inflater.inflate(r.layout.dialogue_cover_staying, null)) // add action buttons .setpositivebutton("done", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int id) { //action } }) .setnegativebutton("cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { finish(); } }); return builder.show(); }
my xml layout:
` <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/back1" android:orientation="vertical"> <textview android:id="@+id/textview2" android:layout_width="match_parent" android:layout_height="60dp" android:layout_weight="0.00" android:background="@drawable/box" android:gravity="center_vertical" android:text="enter covers , guest type" android:textappearance="?android:attr/textappearancelarge" /> <edittext android:id="@+id/et_covers" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginbottom="4dp" android:layout_marginleft="4dp" android:layout_marginright="4dp" android:layout_margintop="35dp" android:fontfamily="sans-serif" android:hint="covers" android:inputtype="number" /> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="10dp" android:layout_margintop="30dp" android:fontfamily="sans-serif" android:text="staying guest...?" android:textappearance="?android:attr/textappearancemedium" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="15dp" > <checkbox android:id="@+id/checkyes" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="50dp" android:text="yes" /> <checkbox android:id="@+id/checkno" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="75dp" android:text="no" /> </linearlayout> </linearlayout> `
change layout width , height "wrap_content" "100dp" example..like this..
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="100dp" android:layout_height="200dp" android:background="@drawable/back1" android:orientation="vertical" >
moreover can set minwidth , minheight..
android:minwidth="300dp" android:minheight="400dp"
Comments
Post a Comment