首页 > 其他分享 >Android预定义样式

Android预定义样式

时间:2023-03-20 13:02:20浏览次数:32  
标签:style attr 样式 height 预定 background Android textColor android


字体大小

对于能够显示文字的控件(如TextView EditText RadioButton Button CheckBox Chronometer等等),你有时需要控制字体的大小。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:textColor="?android:attr/textColorPrimary"
android:textColor="?android:attr/textColorSecondary"
android:textColor="?android:attr/textColorTertiary"
android:textColor="?android:attr/textColorPrimaryInverse"
android:textColor="?android:attr/textColorSecondaryInverse"
ProgressBar

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:background="?android:attr/activatedBackgroundIndicator"

标签:style,attr,样式,height,预定,background,Android,textColor,android
From: https://blog.51cto.com/u_5454003/6132605

相关文章

  • android开发之gallery 实现滚动一张且短距离滑动实现滚动
    首先gallery的特点就不用多说了吧,惯性滚动、半屏翻页,但是很多时候我们不需要它的这些特性。我今天就介绍一下去掉惯性滚动以及短距离翻页的实现:......
  • android上一些方法的区别和用法的注意事项
    onMeasure()和onLayout()1.onMeasurea.属于View的方法,用来测量自己和内容的来确定宽度和高度b.view的measure方法体中会调用onMeasure2.onLayouta.属于ViewG......
  • 【Android 逆向】【攻防世界】Ph0en1x-100
    1.apk安装到手机,老套路需要输入flag2.jadx打开apk,没有加壳......publicvoidonGoClick(Viewv){StringsInput=this.etFlag.getText().toString()......
  • android stdio对于xml中列表的展示
    我们需要用到一个控件,ListView如果愿意深度学习,可以观看下方的文章。(11条消息)Android最常用的控件ListView(详解)_androidlistview_撩得Android一次心动的博客-CSDN博......
  • [Android] Android版本 和 SDK / NDK / Qt 版本对应关系
    系统版本与SDK版本平台版本 API级别(SDK版本)版本代号发布时间Android1130R2020.9Android10.029 Q2019.8Android9.028Pie2018.8Android8.1 27 Oreo2017.12Android8.0......
  • android studio里设置 大括号占一行
    看了书《构建之法》里面有说到建议编程时的那个大括号占一行的,今天学android的时候突然想试试设置 一下,上网搜索了一下,方法如下图:  这样就可以了!!!......
  • Android控件TextProgressBar进度条上显文字
    Android系统的进度条控件默认的设计的不是很周全,比如没有包含文字的显示,那么如何在Android进度条控件上显示文字呢?来自Google内部的代码来了解下,主......
  • Android的Handler总结
    <一>Handler的定义:         主要接受子线程发送的数据,并用此数据配合主线程更新UI.         解释:当应用程序启动时,And......
  • Android AsyncTask异步任务的使用
    文章目录​​小结​​​​定义异步任务类​​​​开启异步任务​​​​参考​​小结可以使用androidAsyncTask来执行繁重的后台任务,以避免UI界面无响应,并可以实时在UI界面......
  • Android自定义长按事件
    Android系统自带了长按事件,setOnLongClickListener即可监听。但是有时候,你不希望用系统的长按事件,比如当希望长按的时间更长一点的时候。这时候就需要......