附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宇姚,當選擇輸入法后,整個布局都會被頂了出去夫凸,
1浑劳,假如不全屏,我的布局一點問題都沒有夭拌,彈出輸入法后魔熏,整體也不移動,listview會根據(jù)空間的大小來顯示scrollbar鸽扁。
2道逗,現(xiàn)在問題就是 全屏后,整體布局被頂了出去
我嘗試過網(wǎng)上的那些修改windowInputMode 什么pan,resize啦献烦,都嘗試過啦滓窍,不行。
個人分析 應該是由于布局中的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為自己標題欄的布局
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>