[英]Android 4.0 softkeyboard overlaps EditText
找不到解决方案,如何避免位于主窗口底部ScrollView下的EditText弹出SoftKeyboard出现重叠。 我花了一天的时间在这里寻找解决方案,但所有建议如下:
我添加了android:descendantFocusability =“ beforeDescendants” android:focusableInTouchMode =“ true”和android:focusable =“ true” android:focusableInTouchMode =“ true”-并没有帮助。
调整清单:
<activity
android:name=".mvc.views.SightingDetailsActivity"
android:theme="@android:style/Theme.Black"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustPan"
/>
已解决低于4.0(2.2、2.3和3.2)的Android的问题,但尚未解决Android 4.0及更高版本的问题。
use scroll View as a parent and put the other layout component as
a child inside this scroll View.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:layout_height="match_parent">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:focusableInTouchMode="true">
<TableRow
android:layout_width="match_parent"
android:padding="20dp"
android:layout_height="wrap_content">
<TextView
android:text="@string/introduction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="27dp"
android:textColor="@color/green"
android:layout_span="4"
android:gravity="center_horizontal"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/green">
<TextView android:layout_span="2"
android:layout_height="1dp"
android:layout_width="match_parent"
android:text="">
</TextView>
</TableRow>
</ScrollView>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.