Toolbar の背景色、文字色、サイズを変更するには?

style.xml で指定

   <!-- Customize Application Theme -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Custom background of application -->
        <item name="android:windowBackground">@color/lightGray</item>
        <!-- Toolbar のnavigation & overflow icon の色 -->
        <item name="colorControlNormal">@color/blue_level4</item>
        <item name="windowActionModeOverlay">true</item>
        <!-- Toolar のスタイル -->
        <item name="toolbarStyle">@style/MyApp.Toolbar</item>
    </style>

    <style name="MyApp.Toolbar" parent="Widget.AppCompat.Toolbar">
        <!-- Toolar 背景色 -->
        <item name="android:background">#00FF00</item>
        <item name="titleTextAppearance">@style/MyTextAppearance</item>
    </style>

    <style name="MyTextAppearance" parent="@android:style/TextAppearance.Medium">
        <!-- Text color -->
        <item name="android:textColor">@android:color/white</item>
        <!-- Text size -->
        <item name="android:textSize">5sp</item>
    </style>

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha