Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6195169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:25:17+00:00 2026-05-24T03:25:17+00:00

Is there a way to format all TextViews, Buttons or whatever with a theme

  • 0

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 to do that in android via xml when I’m applying a theme to my application.
Any ideas ?Thanks

http://bartinger.at/

Update 1.0:
I want to create a theme that formats the text in all TextViews green and in all EditTexts red. So that i just apply the theme and I never have to worry about the style attribute!

Update 1.1:
So I found some that piece of code and I think that’s a good beginning

<item name="android:textViewStyle">@style/MyTextView</item>
<item name="android:buttonStyle">@style/MyButton</item>

I think thats the answer to my question. But I have another one. I want to write my own ActionBar and wanted to know how I can apply a default style or default attributes (again without adding the style attribute in the layout xml 😛 )

I have a class

public class ActionBar extends LinearLayout{ }

and I’m gonna use it like that in my application

<at.bartinger.uil.ActionBar>....</at.bartinger.uil.ActionBar>

The ActionBar should have some default attributes (like height and width) and then adding some custom style attributes which could change from app to app (like background)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:25:18+00:00Added an answer on May 24, 2026 at 3:25 am

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to down-format a Subversion repository to avoid messages like this:
Is there a way to deploy a Java program in a format that is
Is there a way to format the XAML that is generated when a FlowDocument
Is there a way to format the time to look like this: 10h23 I
Like described in title, is there any way to format huge number like 1,000,000
Is there a way to format a double number that always have n digits
Is there a way to select all CSS rules of an element with JavaScript?
Is there any way to format a string by name rather than position in
Is there a way to format a UTC time into any arbitrary string format
Is there a way to format a decimal as following: 100 -> 100 100.1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.