java - How to prevent Alert Dialog Buttons from disappearing when .setView() is too big? (Android) -


i have alert dialog working fine. inflated simple .xml layout. textview set string in html format. far good. problem when .setview() big dialog buttons disappear!!! where they? tell them love them! :'(

how prevent alert dialog buttons disappearing when .setview() big?

screenshots:

1) small, no problem!

2) big, buttons???

this java code in mainactivity.java:

alertdialog.builder dialogbox = new alertdialog.builder(this);  dialogbox.settitle("title");  dialogbox.setmessage("subtitle");    // inflating layout  view alertlayout = getlayoutinflater().inflate( r.layout.scrollable, null );  textview textmsg = (textview)alertlayout.findviewbyid(r.id.textmsg);  textmsg.settext(html.fromhtml("html string"));  dialogbox.setview(alertlayout);    // buttons  dialogbox.setneutralbutton("neutral", null);  dialogbox.setpositivebutton("positive", new dialoginterface.onclicklistener() {      public void onclick(dialoginterface dialog, int id) {          // positive code      }  });  dialogbox.show();

this scrollable.xml file:

<?xml version="1.0" encoding="utf-8"?>    <scrollview      xmlns:android="http://schemas.android.com/apk/res/android"      android:layout_width="wrap_content"      android:layout_height="wrap_content" >        <linearlayout          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:orientation="vertical"          android:paddingleft="20dp"          android:paddingright="20dp">                    <textview              android:id="@+id/textmsg"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:text="dynamic html text."              android:textsize="20sp" />                    </linearlayout>  </scrollview>


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -