我使用TextInputLayout作为我的EditText并显示计数器
但是当键盘出现时,键盘会使计数器变得模糊不清。
android:windowSoftInput:"adjustPan|adjustResize"
对我不起作用。这是XML布局内容
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">]
<TextInputLayout
android:alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:counterMaxLength="300"
app:counterEnabled="true">
<EditText
android:id="@+id/commentEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20sp"
android:textColorHint="@color/blacktransperent"/>
</TextInputLayout>
答案 0 :(得分:1)
android:windowSoftInputMode="adjustPan|adjustResize"
- 在manifest
活动中添加此项,以及您需要的活动