zoukankan      html  css  js  c++  java
  • 设置ActioinBar 的背景色以及Title的字体颜色

         //设置ActionBar背景
            Drawable draw=this.getResources().getDrawable(R.drawable.actionbar_bg);
            getActionBar().setBackgroundDrawable(draw);
        
    //设置ActionBar Title字体的颜色 int titleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android"); TextView title = (TextView)findViewById(titleId); title.setTextColor(this.getResources().getColor(R.color.white));

    drawable/actionbar_bg.xml

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
         android:shape="rectangle">
        <solid android:color="@color/actionbar_bg_color"/>
    </shape>

    valuues/colors.xml

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <!-- ActionBar Background Color -->
        <color name="actionbar_bg_color">#0565CC</color>
    </resources>
  • 相关阅读:
    css float
    java基础77
    java基础75
    java基础73
    java基础72
    java基础71
    java基础630
    django-模版学习
    Django--- 网页显示时间
    创建一个django项目
  • 原文地址:https://www.cnblogs.com/yshyee/p/3476198.html
Copyright © 2011-2022 走看看