这篇文章主要介绍了Android仿微信QQ聊天顶起输入法不顶起标题栏怎么解决的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇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聊天顶起输入法不顶起标题栏怎么解决”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
原文链接:https://www.xuebuyuan.com/3289447.html