Android仿微信QQ聊天頂起輸入法不頂起標(biāo)題欄的問(wèn)題
在這記錄一下輸入法彈出的一系列問(wèn)題,有的輸入法彈出就把整個(gè)布局彈上去,有的輸入法彈出布局不會(huì)有變化,有的輸入法彈出遮蓋輸入框等等問(wèn)題,網(wǎng)上也有很多說(shuō)加著加那的,但是看一下都不是很完整,解決不了所有問(wèn)題,我在這歸納一下大家拿去用吧!
*****先看看做好的效果圖*****

一:AndroidManifest.xml里面對(duì)應(yīng)的activity設(shè)置
android:windowSoftInputMode="adjustResize"
二:在activity的xml根布局設(shè)置
android:fitsSystemWindows="true"
三:為了listview聊天列表的效果,在listview設(shè)置
android:transcriptMode="normal"
四:最后粘貼一下每個(gè)用到的地方代碼
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="輸入聊天內(nèi)容"
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="發(fā)送"
android:textColor="@color/zhucolor"
android:textSize="14dp" />
</RelativeLayout>
</RelativeLayout>
總結(jié)
以上所述是小編給大家介紹的Android仿微信QQ聊天頂起輸入法不頂起標(biāo)題欄的問(wèn)題,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺(jué)得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
相關(guān)文章
Android實(shí)現(xiàn)網(wǎng)絡(luò)加載圖片點(diǎn)擊大圖后瀏覽可縮放
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)網(wǎng)絡(luò)加載圖片點(diǎn)擊大圖后瀏覽可縮放,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-12-12
android里TextView加下劃線的幾種方法總結(jié)
下面小編就為大家?guī)?lái)一篇android里TextView加下劃線的幾種方法總結(jié)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-10-10
基于Android CALL && SendMes Test的相關(guān)介紹
本篇文章小編為大家介紹,Android CALL && SendMes Test 需要的朋友參考下2013-04-04
Android深入探究自定義View之嵌套滑動(dòng)的實(shí)現(xiàn)
什么是嵌套滑動(dòng)?當(dāng)我們向下滑動(dòng)時(shí),首先是外部的布局向下滑動(dòng),然后才是內(nèi)部的RecyclerView滑動(dòng),向上滑動(dòng)也是如此。這就是嵌套滑動(dòng)的效果2021-11-11
Android 中不用線程如何實(shí)現(xiàn)倒計(jì)時(shí)
本文給大家分享android中不用線程如何實(shí)現(xiàn)倒計(jì)時(shí)功能,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友參考下2017-01-01
Android開(kāi)發(fā)重寫(xiě)Animation實(shí)現(xiàn)下拉圖片后彈射回去效果示例
這篇文章主要介紹了Android開(kāi)發(fā)重寫(xiě)Animation實(shí)現(xiàn)下拉圖片后彈射回去效果,結(jié)合實(shí)例形式分析了Android自定義類繼承Animation實(shí)現(xiàn)圖片彈射效果的相關(guān)操作技巧,需要的朋友可以參考下2017-10-10
Android實(shí)現(xiàn)簡(jiǎn)易計(jì)算功能
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)簡(jiǎn)易計(jì)算功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-06-06

