Android theme 设置

来源:互联网 发布:华为麦芒4钢化膜淘宝 编辑:程序博客网 时间:2024/05/17 08:37

1.分为   application 和  activity 中都能设置android:theme。一般最新出现的android:theme可以掩盖先前出现的。

ex:

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.rtstvlc.VideoPlayerActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="landscape"
            android:theme="@style/AppTheme1">


则 红色 掩盖了 蓝色。(猜测:)


2.还可以在代码中设置:一定要在setContentView(R.layout.main)之前。

如下:

    //去掉标题栏
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    //设定风格
   setTheme(android.R.style.Theme_Holo);

 

0 0
原创粉丝点击