附android:ToolBar詳解:
http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/1118/2006.html
http://www.oschina.net/question/1590538_2134301
Activity全屏,看清楚,是全屏,就是沒有statusbar,和title后的activity,在其布局里面,有l(wèi)istview,然后listview底部還有個edittext,當(dāng)選擇輸入法后,整個布局都會被頂了出去,
1,假如不全屏,我的布局一點問題都沒有,彈出輸入法后,整體也不移動,listview會根據(jù)空間的大小來顯示scrollbar。
2,現(xiàn)在問題就是 全屏后,整體布局被頂了出去
我嘗試過網(wǎng)上的那些修改windowInputMode 什么pan,resize啦,都嘗試過啦,不行。
個人分析 應(yīng)該是由于布局中的listview所致,一旦全屏,listview就沒有了限制,這樣,對它來說,全屏就是 屏幕外也會是其空間,原來顯示不下,可以有scrollbar來顯示,一旦全屏,它的內(nèi)容都會到屏幕外面了。
跟ListView沒關(guān)系,試過了,只要全屏,不管上面是什么,都會擠出去,不全屏就沒事,這個會是android的bug嗎。。。
manifest:
<activity
android:name=".ui.main.MainActivity"
android:screenOrientation="landscape"
android:theme="@style/CustomTitle"
android:windowSoftInputMode="adjustResize" >
styles:
<style name="CustomWindowTitleBackground">
<item name="android:background">#FFFFFF</item>
</style>
<style name="CustomTitle" parent="android:Theme.Light">
<item name="android:windowTitleSize">0dp</item>
<item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>
Activity-onCreate():
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main); //軟件activity的布局
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);//titlebar為自己標(biāo)題欄的布局
titlebar.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>