Android改Activity样式(theme)

来源:互联网 发布:c如何定义一维数组 编辑:程序博客网 时间:2024/06/06 14:10

在配置文件中找到Application中theme标签,然后改之。这是改整个app的主题。也可以在配置文件改每个Activity的theme


系统自带:

@android:style/Theme.Black //背景黑色-有标题-非全屏
@android:style/Theme.Black.NoTitleBar //背景黑色-无标题-非全屏
@android:style/Theme.Black.NoTitleBar.Fullscreen //背景黑色-无标题-全屏显示
@android:style/Theme.Dialog //对话框显示

@android:style/Theme.InputMethod
@android:style/Theme.Light //背景白色-有标题-非全屏
@android:style/Theme.Light.NoTitleBar //背景白色-无标题-非全屏
@android:style/Theme.Light.NoTitleBar.Fullscreen //背景白色-无标题-全屏显示
@android:style/Theme.Light.Panel
@android:style/Theme.Light.WallpaperSettings //背景透明
@android:style/Theme.NoDisplay
@android:style/Theme.Translucent.NoTitleBar.Fullscreen //半透明、无标题栏、全屏
@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen


自定义:

例如:

<style name="style">        <item name="android:layout_gravity">center_vertical</item>        <item name="android:layout_marginLeft">20dip</item>        <item name="android:singleLine">true</item>        <item name="android:textColor">@color/black</item>        <item name="android:textSize">23sp</item>    </style>
0 0
原创粉丝点击