Android开发-界面标题被软键盘顶上去的问题

博主介绍:本人专注于Android/java/数据库/微信小程序技术领域的开发,以及有好几年的计算机毕业设计方面的实战开发经验和技术积累;尤其是在安卓(Android)的app的开发和微信小程序的开发,很是熟悉和了解;本人也是多年的Android开发人员;希望我发布的此篇文件可以帮助到您;

🍅点个关注不迷路!🍅

一、问题演示

1:问题演示

2:问题说明 

当软键盘出现的时候,整个布局文件会被顶上去,看着很不好看

二、最后效果

1:演示

三、解决方法

1:步骤一

AndroidManifest.xml对应的activity设置:android:windowSoftInputMode="adjustResize"

2:步骤二

在activity的xml根布局设置:android:fitsSystemWindows="true";也就是最外层控件设置

3:步骤三

对listview控件设置:android:transcriptMode="normal"

4:布局文件代码

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_color_login"
    android:orientation="vertical"
    android:fitsSystemWindows="true"
     >

    <include
        android:id="@+id/rl_title"
        layout="@layout/title_sub_layout" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="3dp" >


        <RelativeLayout

            android:id="@+id/mllbottom"
            android:layout_marginTop="5dp"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@color/white"
            android:layout_alignParentBottom="true" >

            <Button
                android:id="@+id/mbtnUpdate"
                android:layout_width="70dp"
                android:layout_height="fill_parent"
                android:layout_alignParentRight="true"
                android:background="@null"
                android:text="发送"
                android:textStyle="bold"
                android:textColor="#79DDDA" />

            <EditText
                android:id="@+id/replyMessage"
                android:layout_width="match_parent"
                android:layout_height="35dp"
                android:layout_centerVertical="true"
                android:background="@drawable/input_ok"
                android:gravity="center_vertical"
                android:hint="请输入聊天内容"
                android:paddingLeft="15dp"
                android:layout_marginLeft="15dp"

                android:textColor="#666666"
                android:textColorHint="#666666"
                android:layout_toLeftOf="@id/mbtnUpdate"
                android:textSize="14dp" />

        </RelativeLayout>


        <ListView
            android:id="@+id/mListMessage"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@+id/mllbottom"
            android:transcriptMode="normal"
            android:background="#ffffff"
            android:divider="@color/bg_color_login"
            android:dividerHeight="1dp"
            android:listSelector="@drawable/listview"
            android:scrollbars="none" />
    </RelativeLayout>

</LinearLayout>

关注点赞

大家点赞、收藏、关注、评论啦 、查看👇🏻👇🏻👇🏻获取联系方式👇🏻👇🏻👇🏻

  • 13
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Android毕业设计源码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值