繁体   English   中英

出现键盘时,Android EditText并不完全可见

[英]Android EditText was not completely visible when keyboard appears

当键盘出现时,我的EditText并不完全可见,直到焦点出现为止,它都是可见的,但是有可能查看完整的EditText。

在此处输入图片说明

布局

<ScrollView
        android:id="@+id/scrollvew_direct"
        android:isScrollContainer="true"
        android:layout_height="wrap_content">
    <EditText
         android:id="@+id/edt_employers_name"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_marginTop="20dp"
            android:layout_centerHorizontal="true"
            android:inputType="text"
            android:maxLength="100"
            android:hint="@string/dir_deposit_6"
            android:textSize="@dimen/edittextsize_sub"
            android:gravity="center"
            android:layout_gravity="center"
            android:textColor="@color/main_header"
            android:textColorHint="@color/hint_color_light"
            android:background="@drawable/edittext_style"/>
     </ScrollView>

在维护中

<activity
android:name=".activityname"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:theme="@android:style/Theme.Holo.Light.NoActionBar"/>

请指导我寻求适当的解决方案。

在清单的活动标签中,添加此属性

android:windowSoftInputMode="stateAlwaysHidden|adjustResize"

在清单的活动标签中,添加此属性

android:windowSoftInputMode="adjustResize"

编辑 :Edittext高度与背景可绘制对象不完全匹配

使edittext为

android:layout_height="match_parent" or
android:layout_height="wrap_content"

并为我检查它是否正常

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM