关于Android布局中键盘遮挡问题


关于Android布局中键盘遮挡问题


我们都一个误区,就是一直尝试着设置在AndroidManifest.xml文件中的  android:windowSoftInputMode=“”属性,但是一直不尽如人意。


经过多次尝试后发现,现在只需要将包含EditText或者EditText本身外面包裹一层ScrollView这样就可以轻松实现了

<span style="color:#ff0000;"> </span><ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" >

        <RelativeLayout
            android:id="@+id/layout_send_comment"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white" >

            <Button
                android:id="@+id/send_comment_btn_send"
                android:layout_width="50dp"
                android:layout_height="30dp"
                android:layout_alignParentRight="true"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:background="@drawable/shape_forget_pwd"
                android:padding="3dp"
                android:text="@string/video_commnet_send"
                android:textColor="@color/feidiehuang"
                android:textSize="12sp" />

            <EditText
                android:id="@+id/send_comment_edit"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="10dp"
                android:layout_toLeftOf="@id/send_comment_btn_send"
                android:background="@drawable/shape_send_comment"
                android:ems="10"
                android:inputType="none"
                android:paddingLeft="10dp"
                android:selectAllOnFocus="true"
                android:textSize="16sp" />
        </RelativeLayout>
    </ScrollView>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值