I have the layout of a configuration dialog in an XML like this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/timerConfigurationDialog"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:scrollbars="vertical" >
...
</TableLayout>
</ScrollView>
And I use the following code to inflate it:
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.timer_configuration_dialog,
(ViewGroup) findViewById(R.id.timerConfigurationDialog));
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(layout)
.setTitle(R.string.configure)
...;
When I test it in the emulator there is no problem when the screen is vertical because all the components of the dialog are visible but, when the screen is horizontal, the first row and the upper half of the second row are not visible (and, of course, they are out of the reach of the scroll).
I have tried different combinations of layouts without success… any help will be appreciated!!
Thanks in advance,
Raúl
As there were no answer, I have changed the layout of the dialog. Now, I don´t use the TableLayout inside the ScrollView… instead I have a LinearLayout inside the ScrollView, so there is no problem with the dialog when the user rotates the screen.