`
超人二号
  • 浏览: 4408 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

android 中系统自带的主题与样式(theme and style)

 
阅读更多

android中自带的主题(theme)的集锦:
•android:theme="@android:style/Theme.Dialog"   将一个Activity显示为对话框模式
•android:theme="@android:style/Theme.NoTitleBar"  不显示应用程序标题栏
•android:theme="@android:style/Theme.NoTitleBar.Fullscreen"  不显示应用程序标题栏,并全屏
•android:theme="@android:style/Theme.Light"  背景为白色
•android:theme="@android:style/Theme.Light.NoTitleBar"  白色背景并无标题栏
•android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"  白色背景,无标题栏,全屏
•android:theme="@android:style/Theme.Black"  背景黑色
•android:theme="@android:style/Theme.Black.NoTitleBar"  黑色背景并无标题栏
•android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"    黑色背景,无标题栏,全屏
•android:theme="@android:style/Theme.Wallpaper"  用系统桌面为应用程序背景
•android:theme="@android:style/Theme.Wallpaper.NoTitleBar"  用系统桌面为应用程序背景,且无标题栏
•android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"  用系统桌面为应用程序背景,无标题栏,全屏
•android:theme="@android:style/Translucent" 半透明效果
•android:theme="@android:style/Theme.Translucent.NoTitleBar"  半透明并无标题栏
•android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"  半透明效果,无标题栏,全屏
•android:theme="@android:style/Theme.Panel"
•android:theme="@android:style/Theme.Light.Panel"

android中系统自带的样式(style)的集锦:

Android平台定义了三种字体大小。
"?android:attr/textAppearanceLarge"
"?android:attr/textAppearanceMedium"
"?android:attr/textAppearanceSmall"

使用方法:
android:textAppearance="?android:attr/textAppearanceLarge"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAppearance="?android:attr/textAppearanceSmall"

或者
style="?android:attr/textAppearanceLarge"
style="?android:attr/textAppearanceMedium"
style="?android:attr/textAppearanceSmall"

Android字体颜色
android:textColor="?android:attr/textColorPrimary"
android:textColor="?android:attr/textColorSecondary"
android:textColor="?android:attr/textColorTertiary"
android:textColor="?android:attr/textColorPrimaryInverse"
android:textColor="?android:attr/textColorSecondaryInverse"

AndroidProgressBar
style="?android:attr/progressBarStyleHorizontal"
style="?android:attr/progressBarStyleLarge"
style="?android:attr/progressBarStyleSmall"
style="?android:attr/progressBarStyleSmallTitle"

分隔符 横向:
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />

分隔符 纵向:
<View android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="?android:attr/listDivider" />
复制代码
CheckBox 
style="?android:attr/starStyle"

其它 
//类似标题栏效果的TextView
style="?android:attr/listSeparatorTextViewStyle"

//其它有用的样式
android:layout_height="?android:attr/listPreferredItemHeight"

android:paddingRight="?android:attr/scrollbarSize"

style="?android:attr/windowTitleBackgroundStyle"

style="?android:attr/windowTitleStyle"

android:layout_height="?android:attr/windowTitleSize"

android:background="?android:attr/windowBackground"

 

分享到:
评论

相关推荐

    Android系统自带样式 (android:theme)

    在Android开发中,主题(Theme)是控制应用视觉样式的关键元素。它定义了应用程序的整体外观,包括颜色、字体、布局等方面。Android系统内置了一系列预定义的主题,开发者可以根据需求选择使用,而无需从头创建。本...

    Android改Theme实现夜间模式

    首先,理解Android中的Theme(主题)是至关重要的。Theme是Android应用的全局样式,它定义了应用的整体外观和感觉,包括颜色、字体、布局等元素。我们可以创建自定义Theme,并在运行时动态切换,从而实现夜间模式...

    androidStyle

    在Android开发中,"androidStyle"是一个重要的概念,它关乎到应用的视觉呈现和用户体验。风格(Style)允许开发者统一并定制应用中的UI元素外观,包括字体、颜色、尺寸等属性,使得整体界面具有一致性和专业性。下面...

    Android Studio中主题样式的使用方法详解

    Android Studio 中主题样式的使用方法详解 Android Studio 中主题样式的使用方法详解主要介绍了...在 Android 系统中,自带的样式和主题都可以直接拿来用,例如设置主题可以通过 `android:theme="android:style/…"。`

    Android 关于WebView一些注意点

    #### 四、Android系统自带样式 Android系统提供了多种内置样式,可以通过设置`android:theme`属性来改变Activity的外观。下面列举了一些常用的样式: - `@android:style/Theme.Dialog`:将Activity显示为对话框模式...

    Android应用程序替换背景

    这些属性可以在主题(Theme)、样式(Style)或者布局(Layout)中使用,为UI元素提供定制化的属性值。例如,你可以定义一个名为`background_color`的属性,用于指定界面的背景颜色。 创建`attr`的步骤如下: 1. ...

    dialogstyle 去掉背景白色框

    默认样式是由系统主题决定的,其中包含了边框效果。要改变这一默认样式,我们需要创建一个自定义的Dialog主题,并在XML资源文件中定义。 1. 创建自定义主题: 在res/values/styles.xml文件中,添加一个新的主题风格...

    Android 开发之 ToggleButton App 滑动开关按钮

    在Android开发中,`ToggleButton`是一个非常常用的控件,它为用户提供了一种切换状态的方式,类似于现实生活中常见的开关。在本教程中,我们将深入探讨如何在Android应用中使用`ToggleButton`来实现滑动开关效果。 ...

    Android窗体自定义标题栏

    随着Android版本的更新,标题栏的设计和实现方式也在不断变化,从早期的Android系统自带的ActionBar到Material Design中的ToolBar,再到现在的自定义标题栏。本文将围绕“Android窗体自定义标题栏”这一主题,深入...

    android 进度条的颜色水平和圆圈的

    1. **修改主题(Theme)**:在应用程序的主题(res/values/styles.xml)中,你可以自定义一个进度条主题,如`&lt;style name="AppTheme.ProgressBar.Horizontal" parent="Widget.AppCompat.ProgressBar.Horizontal"&gt;`,...

    Android实现无标题栏全屏的方法

    Android中实现全屏、无标题栏的两种办法,另附Android系统自带样式的解释 实现全屏无标题栏: 1.在xml文件中进行配置 AndroidManifest.xml中,找到需要全屏或设置成无标题栏的Activity,在该Activity进行如下配置...

    android SwitchButton 滑动开关按钮

    - **使用Style和Theme**:可以创建自定义样式和主题,通过`android:style`或`android:theme`属性应用到`Switch`上。 - **自定义Drawable**:修改`Switch`的轨道(track)和 thumb(滑块)图片,通过`android:thumb`...

    Android自定义类似ProgressDialog效果的Dialog

    在Android开发中,Dialog是一种非常重要的组件,它用于在用户界面中显示临时信息或与用户进行交互。系统自带的ProgressDialog通常用于表示一个操作正在进行,但它的样式和功能可能无法满足所有设计需求。为了提供更...

    android自定义弹出窗

    9. **主题样式**:如果需要全局统一的风格,可以通过创建自定义的主题(Theme)和样式(Style),然后在弹出窗的布局文件中引用。 10. **兼容性测试**:由于Android设备的多样性,确保自定义弹出窗在不同屏幕尺寸、...

    底部导航栏框架(谷歌自带控件)

    在Android开发中,谷歌为开发者提供了`BottomNavigationView`控件,用于方便地创建底部导航栏。这个框架使得开发者能够轻松地在不同的页面之间切换,提升用户体验。下面将详细探讨`BottomNavigationView`的使用、...

    Android应用源码之MySeekBar.zip

    4. **自定义样式和主题**:`MySeekBar`可能定义了自己的style和theme,这样可以方便地在整个应用中统一控制组件的外观。开发者可能在res/values/styles.xml文件中定义了新的样式,并在布局文件中引用。 5. **事件...

Global site tag (gtag.js) - Google Analytics