Domanda

Well I trying to use custom dialog. it is working normal but if I change to orientation something disappear.

enter image description here

After changing orientation to horizantal

enter image description here

well you can see; top textview and close image are disappearing even after making scroll, they are not coming.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_margin="15dp"
    android:background="@drawable/tarih_ekle"
    android:orientation="vertical" >

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:orientation="vertical" >

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:text="Çözüm"
                    android:textColor="#FFF"
                    android:textSize="20sp"
                    android:textStyle="bold" />

                <ImageView
                    android:id="@+id/canceldialog"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:clickable="true"
                    android:contentDescription="@string/description"
                    android:gravity="center"
                    android:src="@android:drawable/ic_delete" />
            </RelativeLayout>

            <ImageView
                android:id="@+id/cozumresim"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:adjustViewBounds="true"
                android:contentDescription="@string/description" />

            <TextView
                android:id="@+id/cozumyazi"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="#FFF"
                android:textColorHighlight="@android:color/black"
                android:textSize="16sp"
                android:textStyle="bold" />

            <Button
                android:id="@+id/tamamcozum"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Tamam"
                android:textColor="#FFF"
                android:textColorHighlight="@android:color/black"
                android:textSize="18sp"
                android:textStyle="bold" />
        </LinearLayout>
    </ScrollView>

</LinearLayout>
È stato utile?

Soluzione

Well I have fixed it with android:gravity="top" with in xml in default Scrollview is android:gravity="Bottom" if you change your xml it will fix it

 <ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:gravity="top"
        android:orientation="vertical" >
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top