简体   繁体   中英

why my canvas background isn't full screen (Android)?

I copy pasted the methods of the tutorial rocketscissorpaper on my activity but the problem is that when i run my code the canvas background doesn't appear full screen and I see theres no difference between the two projects, even the xml is the same. what am I missing, here is the xml:

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


  <FrameLayout


android:layout_width="match_parent"


android:layout_height="match_parent"


>

 <com.show.showhidebutton.Game
     android:id="@+id/surfaceView" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"

     />


     </FrameLayout>

and here is the manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.show.showhidebutton"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="Show Hide Button"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".Logo"></activity>
    <activity android:name=".Story"></activity>
    <activity android:name=".Survival"></activity>
    <activity android:name=".Store"></activity>
</application>

<application
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

Adding this piece of code will make your application in full screen ,hiding the notification bar.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM