Android中主题的添加

来源:互联网 发布:js判断ie版本是否大于8 编辑:程序博客网 时间:2024/04/30 12:04

在Android系统中,自带的样式和主题都可以直接拿来用,设置样式只需要通过代码style=“?android:attr/...”即可,设置主题只需要通过代码android:theme="android:style/..."即可。


主题是在AndroidManifest.xml文件中添加的,代码:

<application    android:allowBackcup="true"   android:icon="@drawable/ic_launcher"   android:label="@string/app_name"   android:theme="@style/AppTheme"><activity   android:name="cn.itcast.style.MainActivity"  android:theme="@android:style/Theme.Dialog"android:label+"@string/app_name"><intent-filter><action android:name="android.intent.action.MAIN"/><category android:name="android.intent.category.LAUNCHER"/></intent-filter></activity></application>

原创粉丝点击