Android仿微信QQ聊天頂起輸入法不頂起標(biāo)題欄的問題
在這記錄一下輸入法彈出的一系列問題,有的輸入法彈出就把整個布局彈上去,有的輸入法彈出布局不會有變化,有的輸入法彈出遮蓋輸入框等等問題,網(wǎng)上也有很多說加著加那的,但是看一下都不是很完整,解決不了所有問題,我在這歸納一下大家拿去用吧!
*****先看看做好的效果圖*****
一:AndroidManifest.xml里面對應(yīng)的activity設(shè)置
android:windowSoftInputMode="adjustResize"
二:在activity的xml根布局設(shè)置
android:fitsSystemWindows="true"
三:為了listview聊天列表的效果,在listview設(shè)置
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="輸入聊天內(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)題欄的問題,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉(zhuǎn)載,煩請注明出處,謝謝!
相關(guān)文章
ViewPager頂部導(dǎo)航欄聯(lián)動效果(標(biāo)題欄條目多)
這篇文章主要介紹了ViewPager頂部導(dǎo)航欄聯(lián)動效果,代碼簡單易懂,感興趣的朋友參考下吧2016-08-08讓Android中RadioGroup不顯示在輸入法上面的辦法
在Android開發(fā)中,發(fā)現(xiàn)一個問題,打開輸入法導(dǎo)致下面的radioGroup的位置發(fā)生了變化,被頂?shù)搅溯斎敕ǖ纳厦?,那么該如何解決呢?下面來看看。2016-08-08Android實(shí)現(xiàn)外部喚起應(yīng)用跳轉(zhuǎn)指定頁面的方法
這篇文章主要給大家介紹了關(guān)于Android實(shí)現(xiàn)外部喚起應(yīng)用跳轉(zhuǎn)指定頁面的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2018-12-12Android使用自定義view在指定時間內(nèi)勻速畫一條直線的實(shí)例代碼
這篇文章主要介紹了Android使用自定義view在指定時間內(nèi)勻速畫一條直線的實(shí)例代碼,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-05-05Activity配置、啟動和關(guān)閉activity實(shí)例詳解
這篇文章主要介紹了Activity配置、啟動和關(guān)閉activity實(shí)例詳解,非常不錯,具有參考借鑒價(jià)值,需要的朋友可以參考下2016-09-09Android實(shí)現(xiàn)尋覓紅桃A的翻牌游戲
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)尋覓紅桃A的翻牌游戲,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-07-07