全屏显示布局随机图片的显示

全屏显示:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
处理黑屏:style
<style name="AppTheme" parent="android:Theme.Translucent.NoTitleBar.Fullscreen">
    <!--<item name="android:windowDisablePreview">true</item>-->
<activity android:name=".MainActivity"
    android:theme="@style/AppTheme"
    >

m0001Image = (ImageView) findViewById(R.id.image_0001);
//随机数图片的显示

int array[] = {R.drawable.a1, R.drawable.a2, R.drawable.a3, R.drawable.a4,
        R.drawable.a5, R.drawable.a6, R.drawable.a7, R.drawable.a8,
        R.drawable.a9};
Random rnd = new Random();
int index = rnd.nextInt(8);
Resources resources = getBaseContext().getResources();
Drawable cur = resources.getDrawable(array[index]);
m0001Image.setBackgroundDrawable(cur);
窗口主题设置:(这里主要对于Activity设置,用到系统自动主题内容) 

•android:theme=”@android:style/Theme.Dialog” 将一个Activity显示为能话框模式 
•android:theme=”@android:style/Theme.NoTitleBar” 不显示应用程序标题栏 
•android:theme=”@android:style/Theme.NoTitleBar.Fullscreen” 不显示应用程序标题栏,并全屏 
•android:theme=”Theme.Light” 背景为白色 
•android:theme=”Theme.Light.NoTitleBar” 白色背景并无标题栏 
•android:theme=”Theme.Light.NoTitleBar.Fullscreen” 白色背景,无标题栏,全屏 
•android:theme=”Theme.Black” 背景黑色 
•android:theme=”Theme.Black.NoTitleBar” 黑色背景并无标题栏 
•android:theme=”Theme.Black.NoTitleBar.Fullscreen” 黑色背景,无标题栏,全屏 
•android:theme=”Theme.Wallpaper” 用系统桌面为应用程序背景 
•android:theme=”Theme.Wallpaper.NoTitleBar” 用系统桌面为应用程序背景,且无标题栏 
•android:theme=”Theme.Wallpaper.NoTitleBar.Fullscreen” 用系统桌面为应用程序背景,无标题栏,全屏 
•android:theme=”Translucent” 半透明 
•android:theme=”Theme.Translucent.NoTitleBar” 
•android:theme=”Theme.Translucent.NoTitleBar.Fullscreen” 
•android:theme=”Theme.Panel” 
•android:theme=”Theme.Light.Panel”

猜你喜欢

转载自blog.csdn.net/wg_1176075838/article/details/78984657