这篇文章主要介绍了Android之仿微信QQ聊天顶起输入法不顶起标题栏问题,本文实例图文相结合给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
在这记录一下输入法弹出的一系列问题,有的输入法弹出就把整个布局弹上去,有的输入法弹出布局不会有变化,有的输入法弹出遮盖输入框等等问题,网上也有很多说加着加那的,但是看一下都不是很完整,解决不了所有问题,我在这归纳一下大家拿去用吧!
*****先看看做好的效果图*****
一:AndroidManifest.xml里面对应的activity设置
android:windowSoftInputMode="adjustResize"
二:在activity的xml根布局设置
android:fitsSystemWindows="true"
三:为了listview聊天列表的效果,在listview设置
android:transcriptMode="normal"
四:最后粘贴一下每个用到的地方代码
1:AndroidManifest.xml
<!--聊天室-->
<activity
android:name=".activity.ChatRoom"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
2:activity的xml根布局和listview
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/xmlback"
android:fitsSystemWindows="true">
<include
android:id="@+id/include"
layout="@layout/titlelayout" />
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/botton"
android:layout_below="@+id/include"
android:background="@color/xmlback"
android:divider="@null"
android:scrollbars="none"
android:transcriptMode="normal"></ListView>
<RelativeLayout
android:id="@+id/botton"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_alignParentBottom="true"
android:background="@drawable/hlistvbackwl1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toLeftOf="@+id/textsend"
android:background="@drawable/ltback">
<EditText
android:id="@+id/edittext"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:background="@null"
android:hint="输入聊天内容"
android:textSize="14dp" />
</RelativeLayout>
<TextView
android:id="@+id/textsend"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center"
android:text="发送"
android:textColor="@color/zhucolor"
android:textSize="14dp" />
</RelativeLayout>
</RelativeLayout>
总结
以上所述是小编给大家介绍的Android仿微信QQ聊天顶起输入法不顶起标题栏的问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对编程学习网网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
本文标题为:Android仿微信QQ聊天顶起输入法不顶起标题栏的问题


基础教程推荐
- Android实现短信验证码输入框 2023-04-29
- Flutter进阶之实现动画效果(三) 2022-10-28
- Android Compose自定义TextField实现自定义的输入框 2023-05-13
- MVVMLight项目Model View结构及全局视图模型注入器 2023-05-07
- IOS获取系统相册中照片的示例代码 2023-01-03
- Android开发Compose集成高德地图实例 2023-06-15
- iOS中如何判断当前网络环境是2G/3G/4G/5G/WiFi 2023-06-18
- iOS开发 全机型适配解决方法 2023-01-14
- iOS Crash常规跟踪方法及Bugly集成运用详细介绍 2023-01-18
- iOS开发使用XML解析网络数据 2022-11-12