当显示软键盘时,Android布局搞砸了

时间:2012-06-03 16:30:13

标签: android layout soft-keyboard

显示键盘时,我的布局变得混乱。 enter image description here

这是我的android清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.BJ.Food4All"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8" />

    <application
        android:name="CookTales"
        android:icon="@drawable/application_icon"
        android:label="@string/app_name" >
        <activity
            android:screenOrientation="portrait"
            android:name=".MyFood4AllActivity"
            android:label="@string/app_name" 
            android:theme="@android:style/Theme.NoTitleBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".Activities.Mailbox.MailboxActivity"
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.About.AboutDialog"
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.Settings.SettingsActivity"
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name="org.BJ.Food4All.Share_Facebook" />

        <activity android:name=".NewRecipeActivity" 
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.RecipeBookTabHostActivity" 
            android:screenOrientation="portrait"
            android:theme="@style/Theme.Light.NoFrame"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:label="@string/searchRecipe_title" >
        </activity>

        <activity android:name=".Activities.NewRecipe.Ingredients" 
            android:screenOrientation="portrait"
            android:label="@string/ingredients_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.NewRecipe.Instructions" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.NewRecipe.NewRecipeTabHost" 
            android:screenOrientation="portrait"
            android:theme="@style/Theme.Light.NoFrame"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:label="@string/newRecipeTabWidget_title" >
        </activity>

        <activity android:name=".Activities.NewRecipe.General" 
            android:screenOrientation="portrait"
            android:label="@string/newRecipeTabWidget_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.MyBookTab" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@style/Theme.Light.NoFrame" >
        </activity>

        <activity android:name=".Activities.RecipeBook.RecipeBookViewGroup"
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.FavouritesTab"
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.GlobalBookTab" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.ShowRecipeTabHost" 
            android:screenOrientation="portrait"
            android:theme="@style/Theme.Light.NoFrame"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:label="@string/instructions_title" >
            <intent-filter>
                <action android:name="org.BJ.Food4All.myApp.NotifyLikeChanged" />
            </intent-filter>   
        </activity>

        <activity android:name=".Activities.RecipeBook.RecipeGlobalInfoTab" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
            <intent-filter>
                <action android:name="org.BJ.Food4All.myApp.NotifyLikeChanged" />
            </intent-filter>   

        </activity>

        <activity android:name=".Activities.RecipeBook.RecipeInstructionsTab" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.RecipeIngredientsTab" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.RecipeInfoTab" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.RateRecipeActivity" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.WriteReviewActivity" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.RecipeBook.UserInfoActivity" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
            <intent-filter>
                <action android:name="org.BJ.Food4All.myApp.NotifyUserWasUnfriend" />
            </intent-filter>   
        </activity>

        <activity android:name=".Activities.RecipeBook.GlobalBookCategories" 
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity android:name=".Activities.NewRecipe.SnapShot"
            android:screenOrientation="portrait"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.About.AboutActivity"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:label="@string/about_title" >
        </activity>
        <activity android:name="org.BJ.Food4All.Share_Facebook"/>

        <activity
            android:screenOrientation="portrait"
            android:name=".NewRecipeActivity"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:label="@string/newRecipe_title" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.RecipeBookTabHostActivity"
            android:label="@string/searchRecipe_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@style/Theme.Light.NoFrame" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.NewRecipe.Ingredients"
            android:label="@string/ingredients_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.NewRecipe.Instructions"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.NewRecipe.NewRecipeTabHost"
            android:label="@string/newRecipeTabWidget_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@style/Theme.Light.NoFrame" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.NewRecipe.General"
            android:label="@string/newRecipeTabWidget_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.MyBookTab"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@style/Theme.Light.NoFrame" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.RecipeBookViewGroup"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.FavouritesTab"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.GlobalBookTab"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.ShowRecipeTabHost"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@style/Theme.Light.NoFrame" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.RecipeGlobalInfoTab"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.RecipeInstructionsTab"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.RecipeIngredientsTab"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.RecipeInfoTab"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.RateRecipeActivity"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.WriteReviewActivity"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.UserInfoActivity"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.GlobalBookCategories"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.NewRecipe.SnapShot"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.Signup.LoginActivity"
            android:label="@string/instructions_title"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.Friends.FriendsActivity"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.Top10.Top10Activity"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity
            android:screenOrientation="portrait"
            android:name=".Activities.RecipeBook.AllReviewsActivity"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>

        <activity 
            android:screenOrientation="portrait"
            android:name="com.paypal.android.MEP.PayPalActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:configChanges="keyboardHidden|orientation" />

    </application>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>

    <supports-screens 
        android:smallScreens="false" 
        android:largeScreens="true"
        android:normalScreens="true" 
        android:anyDensity="true" />

</manifest>

1 个答案:

答案 0 :(得分:6)

将此添加到您的清单中的活动中:

<activity android:windowSoftInputMode="adjustPan|stateHidden" />