Adjust the height of a Dialog with custom layout in Android -


i have dialog custom layout, working fine, except there big empty spaces @ top cannot remove.

any suggestion how can remove empty space.

here code:

final dialog dialog = new dialog(conferencedetailsactivity.this); dialog.setcontentview(r.layout.l_custom_dialog_name);  final customedittext nametext = (customedittext) dialog.findviewbyid(r.id.confnamefld); nametext.settext(mconferencedetails.getconferencename());  button button = (button) dialog.findviewbyid(r.id.dialogbuttonok); button.setonclicklistener(new onclicklistener() {     public void onclick(view v) {          final customedittext nametext = (customedittext) dialog.findviewbyid(r.id.confnamefld);         string text = nametext.gettext().tostring();          dialog.dismiss();      } });  dialog.show(); 

my xml layout:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent">      <imageview         android:id="@+id/namebackground"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@mipmap/name_badge"         android:layout_alignparenttop="true" />      <com.invosys.iconference.customcontrols.customedittext         android:id="@+id/confnamefld"         android:layout_height="45dp"         android:layout_width="wrap_content"         android:layout_margintop="100dp"         android:layout_marginbottom="20dp"         android:layout_aligntop="@+id/namebackground"         android:layout_alignbottom="@+id/namebackground"         android:layout_alignleft="@+id/namebackground"         android:layout_alignright="@+id/namebackground"         android:background="@null"         android:ems="10"         android:hint="@string/nameplaceholder"         android:gravity="center"         android:isscrollcontainer="false"         android:inputtype="textfilter|textnosuggestions"         android:textcolor="@color/echarcoalcolor" />      <button         android:id="@+id/dialogbuttonok"         android:layout_width="0dp"         android:layout_height="wrap_content"         android:text=" ok "         android:layout_below="@+id/namebackground"         android:layout_alignleft="@+id/namebackground"         android:layout_alignright="@+id/namebackground" /> 


enter image description here

..........................

after used piece of code size reduced still not unto task;

dialog.requestwindowfeature(window.feature_no_title); //before setcontentview     dialog.setcontentview(r.layout.logindialog); 

enter image description here

you can try this:

dialog.requestwindowfeature(window.feature_no_title); //before setcontentview     dialog.setcontentview(r.layout.logindialog); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -