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 6672301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:29:31+00:00 2026-05-26T03:29:31+00:00

I styled specific TextViews and other stuff with styles. Now I want to implement

  • 0

I styled specific TextViews and other stuff with styles. Now I want to implement another theme, which should change espacially the colors which are defined in styles.xml. So is it possible to add all of those styles to a theme and change it on runtime maybe with act.setTheme(themeID);?

Here are some code samples:

ListView Layout.xml (Looks a little bit chaotic but the style attributes should be easy to find.)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

            style="@style/OrangeTheme_ListView_Item"

            android:id="@+id/MainListItemBG" android:padding="10dp"
            android:layout_height="fill_parent"
            android:orientation="vertical" 
            android:layout_width="fill_parent">
    <TextView 
        style="@style/OrangeTheme_ListView_Item_TextHead"

                           android:text="TextView" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/MainList_Head" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>

    <TableLayout  android:stretchColumns ="*" android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/tableLayout1">
        <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content">

                <TextView 
                    style="@style/OrangeTheme_ListView_Item_TextBody" 
                                       android:layout_width="fill_parent" android:text="test"       
                                       android:layout_height="fill_parent" android:id="@+id/MainList_Body_Left"></TextView>

                <TextView 
                   style="@style/OrangeTheme_ListView_Item_TextBody" android:layout_width="fill_parent" android:text="test"  android:layout_height="fill_parent" android:id="@+id/MainList_Body_Right"></TextView>

            </TableRow>



    </TableLayout>

</LinearLayout>

A part of my styles.xml

    <style name="OrangeTheme_ListView">
        <item name="android:background">#FFFFFF</item>
    <item name="android:layout_marginRight">5dp</item>
        <item name="android:layout_marginLeft">5dp</item>
    <item name="android:divider">#FFFFFF</item>
        <item name="android:dividerHeight">5dp</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:cacheColorHint">#00000000</item>          
    </style>


    <style name="OrangeTheme_ListView_Item">
          <item name="android:background">@drawable/orange_theme_lv_bg</item>
          <item name="android:textColor">#000000</item>
          <item name="android:layout_marginRight">10dp</item>
          <item name="android:layout_marginLeft">10dp</item>
          <item name="android:layout_marginBottom">10dp</item>
          <item name="android:layout_marginTop">10dp</item>
    </style>

    <style name="OrangeTheme_ListView_Item_TextHead">
        <item name="android:textColor">#000000</item>
    </style>   

    <style name="OrangeTheme_ListView_Item_TextBody">
        <item name="android:textColor">#000000</item>
        <item name="android:textSize">12sp</item>
    </style>
  • 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-26T03:29:32+00:00Added an answer on May 26, 2026 at 3:29 am

    Unfortunately you can’t change styles at runtime, yet. Here
    is the explanation, why. What you can do is to create different layouts and load them according to the situation your App is in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a specific css class styled which gives glass effect to the various
I'm creating a styled QTreeView using double-dispatch to resolve specific delegate for data items,
I want to print styled html pages with their images from a script. Can
I want to create an asp.net white-label site http://whitelabel.com , that could be styled
I have a TextView and I want to apply a Style which I use
somebody knows if it's possible to set a specific line-height for three20-styled texts? thanks
I've not found an answer really specific to my case, which I would imagine
I need to use specific styles for Mac in my stylesheet. What is the
I am trying to pull in a styled sidebar specific to the category. I
What is the preferred way to store styles very specific to one single dom

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.