像下面显示的图像我的活动正在查看像第二个图像。如何解决此问题。当查看碎片中的软键盘时,顶部相对布局是隐藏的吗?
我面临的问题是,当按下软键盘时,顶部相对布局被隐藏,并且回收站视图被放置在相对布局下面,我完全看到了屏幕。如何解决这个问题。我搜遍了堆栈溢出,但问题没有解决。
XML代码连接下面
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:layout_marginTop="?android:attr/actionBarSize">
<com.onefitstop.utility.CustomTextViewBold
android:id="@+id/chat_activity_label"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/white_partial"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:text="@string/chat_activity"
android:textStyle="bold"
android:textAllCaps="true"
android:textColor="@color/text_voiletlight"
android:textSize="18sp" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_chat_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/chat_activity_label"
android:scrollbars="vertical" />
</RelativeLayout>
<include layout="@layout/error_screen"></include>
</RelativeLayout>
所包含的布局error_screen.xml
<?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:orientation="vertical"
android:visibility="gone"
android:background="@color/white"
android:id="@+id/layoutError">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="200dp"
android:layout_gravity="center"
android:src="@drawable/ic_error_1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<com.onefitstop.utility.CustomTextView
android:id="@+id/txtErrorMsg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/error_msg"
android:textColor="@color/text_voiletlight"
android:textSize="24sp"
android:textStyle="bold" />
<com.onefitstop.utility.CustomButton
android:id="@+id/btnRefresh"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="80dp"
android:layout_marginRight="80dp"
android:layout_marginTop="40dp"
android:gravity="center"
android:text="Refresh"
android:textColor="@color/text_grey"
android:background="@drawable/refresh_button"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
后发生的屏幕截图。 –
和你想做什么写,以及 – Drim
当键盘被按下顶部布局被隐藏 –