Styling all TextViews(or custom view) without adding the style attribute to every TextView

前端 未结 3 766
半阙折子戏
半阙折子戏 2021-01-12 21:01

Is there a way to format all TextViews, Buttons or whatever with a theme ? Like in CSS when i want to format all a-tags

a{ /some css here/ }

I want

相关标签:
3条回答
  • 2021-01-12 21:07

    yes you can you can apply a theme to the whole application and then all your textviews will have that style.

    Inside the styles.xml file you have to define your CustomTheme

    for example:

    <style name="CustomTheme" parent="android:Theme.Light">
      <item name="android:windowBackground">@color/custom_theme_color</item>
      <item name="android:colorBackground">@color/custom_theme_color</item>
    </style>
    

    you add something like text "android:textStyle="myStyle" and specify the details in Mystyle

    0 讨论(0)
  • 2021-01-12 21:15

    for the action abr you should look here http://developer.android.com/guide/topics/ui/actionbar.html

    especially at the bottom it explains very well how to style the bar

    0 讨论(0)
  • 2021-01-12 21:32

    You can apply a style read more here.

    0 讨论(0)
提交回复
热议问题