2012-11-06 25 views
5

我在聲明文件中聲明我的活動,如下所示。android:theme =「@ android:style/Theme.NoTitleBar.Fullscreen」不工作android

<activity 
     android:name=".SiteView" 
     android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
     android:screenOrientation="landscape" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.HOME" /> 
      <category android:name="android.intent.category.DEFAULT" /> 

     </intent-filter> 
    </activity> 

我用Fullscreen theame聲明活動。但它不工作。

我也使用第二種方式來進行Fullscreen,如下所示。

requestWindowFeature(Window.FEATURE_NO_TITLE); 

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 

但是沒有成功。請幫我找到這個。

+1

嘗試增加API級別。 –

+0

@hotveryspicy的意思是?應用程序工作在api級別8. –

+1

它不工作在哪個版本的android? –

回答

9

我通過在應用程序級聲明全屏theame使用解決它。

<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > 
+0

恭喜男人+1。 –

+0

@hotveryspicy謝謝哥們.. –

1

嘗試改變主題爲這樣:android:theme="@android:style/Theme.NoTitleBar"

1

這是爲我工作: -

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