Naprawiono przycisk, który pozostaje nawet wtedy, gdy przeglądarka viewPager jest przesuwana
Mam przycisk zamykania [x] w dwóch moich xml (z pływającym motywem dialogowym), z którym korzystam z viewPager.
Przycisk zamykania znajduje się w prawym górnym rogu dwóch xml. Jednak, jak przesuwa się w lewo lub w prawo, przycisk przesuwa się do iz powrotem, co wygląda naprawdę dziwnie. Jakikolwiek pomysł, aby przycisk pozostał niezmieniony, nawet po przesunięciu stron?
Kod z jednej strony (obie strony są podobne):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="350dp"
android:minHeight="700dp"
android:background="#CECECE"
android:id="@+id/dialogLayout"
android:orientation="vertical">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/lblInfo"
android:layout_marginLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-6dp"
android:text="Information"
android:textStyle="bold"
android:textColor="#000"
android:textSize="40dp" />
<ImageButton
android:id="@+id/btnClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="320dp"
android:layout_marginTop="-4dp"
android:layout_marginRight="-4dp"
android:background="#0000"
android:src="@drawable/close" />
</TableRow>
<TextView
android:id="@+id/lblInfo"
android:layout_width="wrap_content"
android:layout_height="400dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dp"
android:textColor="#000"
android:textSize="17dp" />
</LinearLayout>
XML viewPager
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="612dp"
android:layout_height="700dp">
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>