修改样式和主题
来源:互联网 发布:python获取日期字符串 编辑:程序博客网 时间:2024/05/21 17:06
样式:首先是看到有这些组件对吧,然后呢,我们要方便修改,就在values下面style里面修改
<TextView
android:text="@string/hello_world"
style="@style/jiangnanstyle"
/>
<TextView
android:text="@string/hello_world"
style="@style/panzi"
/>
<TextView
android:text="@string/hello_world"
style="@style/panzi.munai"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
android:textSize="22sp"
android:textColor="#ff0000"
/>
---------------------------------------------------------
style页面:
</style>
<stylename="jiangnanstyle">
<itemname="android:layout_width">wrap_content</item>
<itemname="android:layout_height">wrap_content</item>
<itemname="android:textSize">22sp</item>
<itemname="android:textColor">#ff0000</item>
</style>
<stylename="panzi"parent="jiangnanstyle">
<itemname="android:textSize">30sp</item>
</style>
<stylename="panzi.munai"parent="jiangnanstyle">
<itemname="android:textColor">#0000ff</item>
</style>
-----------------------------------------------------------------
然后我们说说主题,主题的修改,要么用系统自带的,在清单配置文件里面处理。另外一种就是直接在style里面设置
系统自带的:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black">
<activity
android:name="com.example.styleandtheme.MainActivity"
android:label="@string/app_name">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>
<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
------------------------------------------------------------
style:注意,这个定义完之后,要在清单配置文件中使用
<stylename="mytheme">
<itemname="android:background">#ff0000</item>
</style>
在MANNIFIST中使用
android:theme="@android:style/mythmem"
0 0
- 修改样式和主题
- 修改主题和样式
- Octopress主题样式修改
- 样式和主题&自定义样式和主题
- 样式和主题 + 自定义样式和主题
- 样式和主题之样式
- android 样式和主题
- flex---->样式和主题
- 样式和主题
- android样式和主题
- 样式和主题
- android样式和主题
- Android样式和主题
- Android 样式和主题
- android 样式和主题
- android样式和主题
- android样式和主题
- android主题和样式
- Git 基本操作
- 创建图片副本
- LeetCode 150. Evaluate Reverse Polish Notation
- 多媒体编程,加载大图片
- 2016 百度之星 大搬家
- 修改样式和主题
- 单调递增最长子序列
- 进程优先级 processes and Threads
- NYOJ 995 硬币找零(完全背包)
- Next Permutation
- 经典算法<一>迷宫问题 1.单条路径 DFS求解 C++实现
- APP使用支付宝业务
- Forrest 2015年第三季度内存网格分析报告
- myeclipse更换主题