天天看點

關于Android 軟鍵盤覆寫布局問題

設定方法一:

在activity注冊的清單中加入以下代碼OK

android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait"                android:windowSoftInputMode="adjustResize|stateHidden"
           

參數介紹自己百度

設定方法二:在頂級布局中嵌入以下的代碼

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/ScrollView01"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

<!-- 此處添加所包裹的頂級布局-->

</ScrollView>
           

個人傾向第二種