Как я могу сделать свой диалог Android полноэкранным?

Я уже перепробовал все, что мог найти (в stackoverflow и сети ), но я почему-то не могу установить свой диалог в полноэкранный режим. У него есть прокрутка с текстовым представлением, и когда в текстовом представлении не так много текста, прокрутка не является полноэкранной. Как я могу заставить его быть полноэкранным, даже если текста не видно?

Я создаю такой диалог:

    final   TextView    box;
    final   Dialog      info    = new Dialog(cx);
    final   ScrollView  scroll;

    info.setContentView(R.layout.dialoginfo);
    info.setTitle("Info");
    info.setCancelable(true);
    info.getWindow().setFlags(LayoutParams.FLAG_FULLSCREEN, LayoutParams.FLAG_FULLSCREEN);

    scroll = ((ScrollView) info.findViewById(R.id.scrollviewinfo));
    scroll.setPersistentDrawingCache(ScrollView.PERSISTENT_NO_CACHE);
    scroll.setScrollbarFadingEnabled(false);
    box = (TextView) info.findViewById(R.id.infotext);
    box.setText(text);
    info.show();

Это xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:id="@+id/infolayout"
>

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ImageView01"
        android:layout_weight="1.0"
        android:id="@+id/scrollviewinfo">

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:id="@+id/infolayout2">

            <TextView   android:layout_margin="5dip" android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:id="@+id/infotext"
                android:textSize="8sp" 
                android:text=""/>

        </LinearLayout>

    </ScrollView>


</LinearLayout>
5
задан HardCoder 1 May 2012 в 13:52
поделиться