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

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"
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)用程序中。
<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è)置方法:
<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è)置:
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setTheme(android.R.style.Theme_Translucent_NoTitleBar);
setContentView(R.layout.main);
}
-------------跳轉(zhuǎn)---------------------
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();
}
---------為按鈕添按下效果-----------
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;
}
});
- Android使用Intent的Action和Data屬性實(shí)現(xiàn)點(diǎn)擊按鈕跳轉(zhuǎn)到撥打電話(huà)和發(fā)送短信界面
- Android倒計(jì)時(shí)控件 Splash界面5秒自動(dòng)跳轉(zhuǎn)
- Android 6.0動(dòng)態(tài)權(quán)限及跳轉(zhuǎn)GPS設(shè)置界面的方法
- android 跳轉(zhuǎn)到應(yīng)用通知設(shè)置界面的示例
- Android如何通過(guò)scheme跳轉(zhuǎn)界面
- Android中檢查網(wǎng)絡(luò)連接狀態(tài)的變化無(wú)網(wǎng)絡(luò)時(shí)跳轉(zhuǎn)到設(shè)置界面
- Android 中按home鍵和跳轉(zhuǎn)到主界面的實(shí)例代碼
- Android跳轉(zhuǎn)到系統(tǒng)聯(lián)系人及撥號(hào)或短信界面
- Android編程使用Fragment界面向下跳轉(zhuǎn)并一級(jí)級(jí)返回的實(shí)現(xiàn)方法
- Android實(shí)現(xiàn)界面跳轉(zhuǎn)功能
相關(guān)文章
Android自定義View實(shí)現(xiàn)雪花特效
這篇文章主要為大家詳細(xì)介紹了Android自定義View實(shí)現(xiàn)雪花特效,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-02-02Android 使用Picasso加載網(wǎng)絡(luò)圖片等比例縮放的實(shí)現(xiàn)方法
在做android圖片加載的時(shí)候,由于手機(jī)屏幕受限,很多大圖加載過(guò)來(lái)的時(shí)候,我們要求等比例縮放,接下來(lái)小編給大家?guī)?lái)了Android 使用Picasso加載網(wǎng)絡(luò)圖片等比例縮放的實(shí)現(xiàn)方法,感興趣的朋友一起看看吧2018-08-08詳解Android 利用Iptables實(shí)現(xiàn)網(wǎng)絡(luò)黑白名單(防火墻)
這篇文章主要介紹了詳解Android 利用Iptables實(shí)現(xiàn)網(wǎng)絡(luò)黑白名單(防火墻),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-08-08Android自定義RadioGroupX實(shí)現(xiàn)多行多列布局
這篇文章主要為大家詳細(xì)介紹了Android自定義RadioGroupX實(shí)現(xiàn)多行多列布局,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-09-09Android 10 啟動(dòng)Init進(jìn)程解析
這篇文章主要為大家介紹了Android 10 啟動(dòng)Init進(jìn)程解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-10-10關(guān)于OkHttp中response.body().string()的用法解析
這篇文章主要介紹了關(guān)于OkHttp中response.body().string()的用法解析,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-06-06android實(shí)現(xiàn)指紋識(shí)別功能
這篇文章主要介紹了android指紋識(shí)別功能,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-09-09Android 中使用ExpandableListView 實(shí)現(xiàn)分組的實(shí)例
這篇文章主要介紹了Android 中使用ExpandableListView 實(shí)現(xiàn)分組的實(shí)例的相關(guān)資料,這里提供實(shí)例代碼及實(shí)現(xiàn)效果圖,需要的朋友可以參考下2016-12-12Flutter桌面開(kāi)發(fā)windows插件開(kāi)發(fā)
這篇文章主要為大家介紹了Flutter桌面開(kāi)發(fā)windows插件開(kāi)發(fā)示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-11-11