欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android中應(yīng)用界面主題Theme使用方法和頁(yè)面定時(shí)跳轉(zhuǎn)應(yīng)用

 更新時(shí)間:2013年06月14日 15:30:06   作者:  
在Android SDK中內(nèi)置了下面的Theme,可以按標(biāo)題欄Title Bar和狀態(tài)欄Status Bar是否可見(jiàn)來(lái)分類(lèi),感興趣的朋友可以了解下哈
主題Theme就是用來(lái)設(shè)置界面UI風(fēng)格,可以設(shè)置整個(gè)應(yīng)用或者某個(gè)活動(dòng)Activity的界面風(fēng)格。在Android SDK中內(nèi)置了下面的Theme,可以按標(biāo)題欄Title Bar和狀態(tài)欄Status Bar是否可見(jiàn)來(lái)分類(lèi):
 
復(fù)制代碼 代碼如下:

android:theme="@android:style/Theme.Dialog" 將一個(gè)Activity顯示為能話(huà)框模式
android:theme="@android:style/Theme.NoTitleBar" 不顯示應(yīng)用程序標(biāo)題欄
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不顯示應(yīng)用程序標(biāo)題欄,并全屏
android:theme="Theme.Light" 背景為白色
android:theme="Theme.Light.NoTitleBar" 白色背景并無(wú)標(biāo)題欄
android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,無(wú)標(biāo)題欄,全屏
android:theme="Theme.Black" 背景黑色
android:theme="Theme.Black.NoTitleBar" 黑色背景并無(wú)標(biāo)題欄
android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,無(wú)標(biāo)題欄,全屏
android:theme="Theme.Wallpaper" 用系統(tǒng)桌面為應(yīng)用程序背景
android:theme="Theme.Wallpaper.NoTitleBar" 用系統(tǒng)桌面為應(yīng)用程序背景,且無(wú)標(biāo)題欄
android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系統(tǒng)桌面為應(yīng)用程序背景,無(wú)標(biāo)題欄,全屏
android:theme="Translucent" 半透明
android:theme="Theme.Translucent.NoTitleBar" 半透明、無(wú)標(biāo)題欄
android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、無(wú)標(biāo)題欄、全屏
android:theme="Theme.Panel"
android:theme="Theme.Light.Panel"

復(fù)制代碼 代碼如下:

android:theme="@android:style/Theme.Dialog" 將一個(gè)Activity顯示為能話(huà)框模式
android:theme="@android:style/Theme.NoTitleBar" 不顯示應(yīng)用程序標(biāo)題欄
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不顯示應(yīng)用程序標(biāo)題欄,并全屏
android:theme="Theme.Light" 背景為白色
android:theme="Theme.Light.NoTitleBar" 白色背景并無(wú)標(biāo)題欄
android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,無(wú)標(biāo)題欄,全屏
android:theme="Theme.Black" 背景黑色
android:theme="Theme.Black.NoTitleBar" 黑色背景并無(wú)標(biāo)題欄
android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,無(wú)標(biāo)題欄,全屏
android:theme="Theme.Wallpaper" 用系統(tǒng)桌面為應(yīng)用程序背景
android:theme="Theme.Wallpaper.NoTitleBar" 用系統(tǒng)桌面為應(yīng)用程序背景,且無(wú)標(biāo)題欄
android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系統(tǒng)桌面為應(yīng)用程序背景,無(wú)標(biāo)題欄,全屏
android:theme="Translucent" 半透明
android:theme="Theme.Translucent.NoTitleBar" 半透明、無(wú)標(biāo)題欄
android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透明、無(wú)標(biāo)題欄、全屏
android:theme="Theme.Panel"
android:theme="Theme.Light.Panel"

這些主題可以應(yīng)用到整個(gè)應(yīng)用Application范圍或者某個(gè)活動(dòng)Activity范圍中。
應(yīng)用Application范圍
在AndroidManifest.xml中的application節(jié)點(diǎn)中設(shè)置theme屬性,主題theme應(yīng)用到整個(gè)應(yīng)用程序中。
復(fù)制代碼 代碼如下:

<application
Android:icon=”@drawable/icon”
Android:icon=”@string/app_name”
Android:icon=”@android:style/ Theme.Black.NoTitleBar”>

活動(dòng)Activity范圍
使用java代碼或者在AndroidManifest.xml中對(duì)活動(dòng)Activity的主題進(jìn)行設(shè)置,主題僅應(yīng)用到當(dāng)前活動(dòng)中。
在AndroidMainifest.xml設(shè)置方法:
復(fù)制代碼 代碼如下:

<activity
android:name=“.About”
android:label=“@string/app_name”
android:theme=“@android:style/ Theme.Black.NoTitleBar” >

使用java代碼進(jìn)行設(shè)置,在當(dāng)前活動(dòng)Activity的onCreate中進(jìn)行設(shè)置:
復(fù)制代碼 代碼如下:

@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setTheme(android.R.style.Theme_Translucent_NoTitleBar);
setContentView(R.layout.main);
}

-------------跳轉(zhuǎn)---------------------
復(fù)制代碼 代碼如下:

public void Start() {
new Thread() {
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Intent intent = new Intent();
intent.setClass(WelComeActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
}.start();
}

---------為按鈕添按下效果-----------
復(fù)制代碼 代碼如下:

imageButton1 = (ImageButton) findViewById(R.id.imageButton3);
imageButton1.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
// 更改為按下時(shí)的背景圖片
v.setBackgroundResource(R.drawable.menu_btn_f);
} else if (event.getAction() == MotionEvent.ACTION_UP) {
// 改為抬起時(shí)的圖片
v.setBackgroundResource(R.drawable.menu_btn);
}
return false;
}
});

相關(guān)文章

最新評(píng)論