1、首先,在values目录下,新建一个styles.xml文件:

使用Eclipse为Android定义style

2、进入styles.xml文件,点击Resources:使用Eclipse为Android定义style

3、点击Add按钮,在弹出的对话框中选择在顶层创建新元素,在选择Style/Theme,点击OK:使用Eclipse为Android定义style

4、选中新建的Style/Theme,输入名字my_style:使用Eclipse为Android定义style

5、选中my_style,点击Add:

使用Eclipse为Android定义style

6、双击Item,在Name中输入android:textSize,Value中输入25sp:使用Eclipse为Android定义style

7、按照同样方法,新建一个android:textStyle:

使用Eclipse为Android定义style

8、点击保存后,为TextView的Style属性选择my_style:

使用Eclipse为Android定义style

9、得到想要的结果,对其他控件同样适用:

使用Eclipse为Android定义style

 

 

相关文章:

  • 2022-12-23
  • 2022-02-13
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-22
  • 2021-09-13
  • 2021-12-25
  • 2021-10-26
  • 2022-12-23
相关资源
相似解决方案