即使在滚动视图中,键盘覆盖我的编辑文本和按钮的一半时,我也遇到麻烦。
这是我的布局,请告诉我如何解决此问题。他们有很多与此主题有关的问题,但没有一个对我有用。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@drawable/bg"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical"
android:paddingBottom="60dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/abc_action_bar_subtitle_bottom_margin_material"
android:layout_marginLeft="@dimen/abc_action_bar_overflow_padding_end_material"
android:layout_marginRight="@dimen/abc_action_bar_overflow_padding_end_material"
android:layout_marginTop="@dimen/abc_action_bar_subtitle_bottom_margin_material"
android:background="@drawable/login_layout_bg"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp">
<EditText
android:id="@+id/reg_email"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:background="@android:color/transparent"
android:hint="Username"
android:inputType="textEmailAddress"
android:singleLine="true"
android:textColor="@color/textcolor3"
android:textColorHint="@color/about_libraries_card_dark" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:background="@color/md_grey_700" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/client_icon" />
</TableRow>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<TableRow
android:id="@+id/register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/abc_action_bar_overflow_padding_end_material"
android:layout_marginLeft="@dimen/abc_action_bar_overflow_padding_end_material"
android:layout_marginRight="@dimen/abc_action_bar_overflow_padding_end_material"
android:layout_marginTop="@dimen/abc_action_bar_subtitle_bottom_margin_material"
android:background="@drawable/login_btn_bg"
android:padding="@dimen/abc_action_bar_overflow_padding_end_material">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Register"
android:textColor="@android:color/white" />
</TableRow>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>