2013-03-02 40 views
1

我复制粘贴教程rocketscissorpaper的方法对我的活动,但 的问题是,当我运行我的代码画布背景不会出现全屏幕,我看到这两个项目之间没有区别,即使是xml是这样的一样。我缺少什么,这里是 的XML:为什么我的画布背景不是全屏(Android)?

<?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> 

+0

可能是'manifest'文件,会有更好的想法吗? – SudoRahul 2013-03-02 09:15:21

回答

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

机器人:主题= “@安卓风格/ Theme.NoTitleBar.Fullscreen”

添加这段代码将使您的应用程序全屏,隐藏通知栏。

希望它有帮助。

+0

请发布错误日志猫 – 2013-03-02 12:30:15

+0

我只是想320x600位图填充屏幕不去除标题栏 – 2013-03-02 12:53:43

+0

屏幕的一半是黑色的 – 2013-03-02 12:56:39