【问题标题】:why my canvas background isn't full screen (Android)?为什么我的画布背景不是全屏(Android)?
【发布时间】:2013-03-02 09:05:42
【问题描述】:

我将教程 Rocketscissorpaper 的方法复制粘贴到我的活动中,但是 问题是当我运行我的代码时,画布背景没有全屏显示,我看到了 两个项目没有区别,连xml都一样。我错过了什么,这是 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>

【问题讨论】:

  • 可能是manifest 文件,能给个更好的主意吗?

标签: android android-layout android-canvas android-xml


【解决方案1】:
<application
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

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

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

希望对你有帮助。

【讨论】:

  • 我只是想让 320x600 位图填满屏幕而不是删除标题栏
  • 一半屏幕是黑色的
猜你喜欢
  • 2021-09-18
  • 1970-01-01
  • 2021-10-31
  • 2021-12-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-11
相关资源
最近更新 更多