How to make my app full screen on Galaxy Tab

后端 未结 8 1334
余生分开走
余生分开走 2020-12-30 11:29

I\'ve been trying everything I can think of to get my app to display full screen on the Galaxy Tab.

Basically, it works like the Lunar Lander example app that comes

相关标签:
8条回答
  • 2020-12-30 11:40

    <uses-sdk android:minSdkVersion="4" />

    or an other version number is missing in your manifest

    0 讨论(0)
  • 2020-12-30 11:41

    Unless you support SDK versions that are at least 4, i.e.:
    <uses-sdk android:minSdkVersion="4"/>,

    you will have to do the following explicitly:

    <supports-screens android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:anyDensity="true" />
    
    0 讨论(0)
  • 2020-12-30 11:45

    Give this one in your manifest file:

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

    Surely it will work.

    0 讨论(0)
  • 2020-12-30 11:46

    If you set your target sdk level to anything less than 9, then support for extra-large screens is assumed to be false. If you set targetSdkVersion=9 in the manifest, then xlarge support is assumed to be true. See the documentation on Supporting Multiple Screens, in particular the description of compatibility mode.

    0 讨论(0)
  • 2020-12-30 11:46

    another way to do is creating a xml called styles.xml in res/values

    define a style:

    <style name="Theme.FullScreen" parent="android:Theme">
            <item name="android:windowFullscreen">true</item>
            <item name="android:windowNoTitle">true</item>
        </style>
    

    later in the manifest, tell android what activity must be in fullscreen setting the style above:

    <activity android:name=".activity.NewSearchBrowserActivity" android:theme="@style/Theme.FullScreen" android:screenOrientation="landscape"></activity>
    

    in this way you make a reusable theme what can be applied to any activity.

    0 讨论(0)
  • 2020-12-30 11:52

    you can add this exactly under

      super.onCreate(savedInstanceState);
    

    of the activity you want to be full screen.

     requestWindowFeature(Window.FEATURE_NO_TITLE);
     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN);  
    
    0 讨论(0)
提交回复
热议问题