Android-主题样式基本方式

来源:互联网 发布:51单片机与蓝牙模块 编辑:程序博客网 时间:2024/06/05 10:41
在res-->values-->styles.xml文件中定义样式:
<span style="font-family:KaiTi_GB2312;font-size:18px;"><style name="jiangnanstyle">        <item name="android:layout_width">wrap_content</item>        <item name="android:layout_height">wrap_content</item>        <item name="android:textSize">22sp</item>        <item name="android:textColor">#00ff00</item>    </style>        <style name="pangzhi" parent="jiangnanstyle">        <item name="android:textSize">30sp</item>    </style>        <style name="pangzhi.lizhi" >        <item name="android:textColor">#0000ff</item>    </style>        <style name="myTheme">        <item name="android:background">#ff0000</item>    </style></span>

在AndroidManifest.xml文件中引用主题:
在application标签下的     android:theme="@style/myTheme"   引用样式中的name即可;
0 0
原创粉丝点击