android style举例
2015-11-22 23:28
323 查看
<resources> <style name="AppBaseTheme" parent="android:Theme.Light"></style> <style name="AppTheme" parent="AppBaseTheme"></style> <style name="mystyle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:background">#A1B9E7</item> <item name="android:textSize">20sp</item> <item name="android:textColor">#F15963</item> <item name="android:text">hehe</item> </style> </resources>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView style="@style/mystyle" />
<TextView style="@style/mystyle" />
<TextView style="@style/mystyle" />
<TextView style="@style/mystyle" />
<TextView style="@style/mystyle" />
</LinearLayout>
结果
样式可以继承,加上这句
<style name="mystyle" parent="@style/AppBaseTheme">
相关文章推荐
- Android之自定义组件
- Android Bundle的使用及与Intent传递参数区别
- Android对话框详解
- Android进程
- android中用GET和POST的方法向服务器上传数据
- Android图片色彩变幻
- Android 属性动画
- Android图片色彩变幻
- Android AIDL:跨进程调用Service (AIDL Service)
- Android实践项目汇报(三)
- Android 中文文档
- Android中dip、dp、sp、pt和px的区别
- Android学习笔记(一)
- Android自定义控件实现
- Android Studio的使用(十四)--如何查看资源或者函数在哪些类中被引用
- 教你搞定Android自定义ViewGroup
- android 通知
- Android开发手记(32) 使用摄像头拍照
- selector.xml(选择器)
- Android中多线程的用法