久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

Android基礎(chǔ)教程之-------Android中兩種設(shè)置全屏的方法!!! - And...

 liluvu 2010-11-15
在開發(fā)中我們經(jīng)常需要把我們的應(yīng)用設(shè)置為全屏,,這里我所知道的有倆中方法,,一中是在代碼中設(shè)置,,另一種方法是在配置文件里改!
一,、在代碼中設(shè)置:
view plaincopy to clipboardprint?
package com.android.tutor;        
import android.app.Activity;        
import android.os.Bundle;        
import android.view.Window;        
import android.view.WindowManager;        
public class OpenGl_Lesson1 extends Activity {        
        public void onCreate(Bundle savedInstanceState) {        
                super.onCreate(savedInstanceState);        
             //無title            
             requestWindowFeature(Window.FEATURE_NO_TITLE);            
                //全屏            
             getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,                
                                            WindowManager.LayoutParams. FLAG_FULLSCREEN);        
                        
                setContentView(R.layout.main);        
        }        
}    
package com.android.tutor;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class OpenGl_Lesson1 extends Activity {
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
             //無title    
             requestWindowFeature(Window.FEATURE_NO_TITLE);    
                //全屏    
             getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,        
                                            WindowManager.LayoutParams. FLAG_FULLSCREEN);    
                    
                setContentView(R.layout.main);
        }
}    

在這里要強(qiáng)調(diào)一點(diǎn),設(shè)置全屏的倆段代碼必須在setContentView(R.layout.main) 之前,,不然會(huì)報(bào)錯(cuò),。
二,、在配置文件里修改
(android:theme="@android:style/Theme.NoTitleBar.Fullscreen"):

view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>        
<manifest xmlns:android="http://schemas.android.com/apk/res/android"    
            package="com.android.tutor"    
            android:versionCode="1"    
            android:versionName="1.0">        
        <application android:icon="@drawable/icon" android:label="@string/app_name">        
                <activity android:name=".OpenGl_Lesson1"    
                                    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"    
                                    android:label="@string/app_name">        
                        <intent-filter>        
                                <action android:name="android.intent.action.MAIN" />        
                                <category android:name="android.intent.category.LAUNCHER" />        
                        </intent-filter>        
                </activity>        
        </application>        
        <uses-sdk android:minSdkVersion="7" />        
</manifest>        
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="com.android.tutor"
            android:versionCode="1"
            android:versionName="1.0">
        <application android:icon="@drawable/icon" android:label="@string/app_name">
                <activity android:name=".OpenGl_Lesson1"
                        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
                                    android:label="@string/app_name">
                        <intent-filter>
                                <action android:name="android.intent.action.MAIN" />
                                <category android:name="android.intent.category.LAUNCHER" />
                        </intent-filter>
                </activity>
        </application>
        <uses-sdk android:minSdkVersion="7" />
</manifest>    

在這里我還想說明一下,用前者在我們應(yīng)用運(yùn)行后,,會(huì)看到短暫的狀態(tài)欄,,然后才全屏,而第二種方法是不會(huì)有這種情況的,,所以我建議
大家使用后者,! 謝謝~

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn),。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多