Android仿微信QQ聊天顶起输入法不顶起标题栏的问题

 更新时间:2019年11月18日 11:16:19   作者:没心没肺没网名  
这篇文章主要介绍了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应用开发中使用GridView网格布局的代码示例

    Android应用开发中使用GridView网格布局的代码示例

    GridView布局比较基础,可以取代已经逐渐淡出人们视线的TableLayout,这里我们就来看一下Android应用开发中使用GridView网格布局的代码示例:
    2016-06-06
  • Android内置的OkHttp用法介绍

    Android内置的OkHttp用法介绍

    okhttp是一个第三方类库,用于android中请求网络。这是一个开源项目,是安卓端最火热的轻量级框架,由移动支付Square公司贡献(该公司还贡献了Picasso和LeakCanary) 。用于替代HttpUrlConnection和Apache HttpClient
    2022-08-08
  • Android中RecyclerView实现分页滚动的方法详解

    Android中RecyclerView实现分页滚动的方法详解

    RecyclerView实现滚动相信对大家来说都不陌生,但是本文主要给大家介绍了利用Android中RecyclerView实现分页滚动的思路和方法,可以实现翻页功能,一次翻一页,也可以实现翻至某一页功能。文中给出了详细的示例代码,需要的朋友可以参考借鉴,下面来一起看看吧。
    2017-04-04
  • 使用Android Studio实现为系统级的app签名

    使用Android Studio实现为系统级的app签名

    这篇文章主要介绍了使用Android Studio实现为系统级的app签名,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2020-03-03
  • Android MediaPlayer实现音乐播放器实例代码

    Android MediaPlayer实现音乐播放器实例代码

    这篇文章主要介绍了Android MediaPlayer实现音乐播放器实例代码的相关资料,需要的朋友可以参考下
    2017-01-01
  • android使用viewpager计算偏移量实现选项卡功能

    android使用viewpager计算偏移量实现选项卡功能

    这篇文章主要为大家详细介绍了android使用viewpager计算偏移量实现选项卡功能,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2018-12-12
  • android中px、sp与dp之间进行转换详解

    android中px、sp与dp之间进行转换详解

    android中在xml布局中我们可以使用dp和px都可以,但是在代码中,很多方法只提供了设置px的方法,这时候就需要用到dp和px相互切换了,下面这篇文章主要给大家介绍了关于android中px、sp与dp之间进行转换的相关资料,需要的朋友可以参考下
    2022-08-08
  • Android加载对话框同时异步执行实现方法

    Android加载对话框同时异步执行实现方法

    Android中通过子线程连接网络获取资料,同时显示加载进度对话框给用户的操作
    2012-11-11
  • Android实现SwipeRefreshLayout首次进入自动刷新

    Android实现SwipeRefreshLayout首次进入自动刷新

    这篇文章主要为大家详细介绍了Android实现SwipeRefreshLayout首次进入自动刷新,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2017-01-01
  • Android 仿高德地图可拉伸的BottomSheet的示例代码

    Android 仿高德地图可拉伸的BottomSheet的示例代码

    这篇文章主要介绍了Android 仿高德地图可拉伸的BottomSheet的示例代码,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2018-07-07

最新评论