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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:39:41+00:00 2026-05-22T02:39:41+00:00

How to change the color of Title text in CheckBoxPreference?

  • 0

How to change the color of Title text in CheckBoxPreference?

  • 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-22T02:39:42+00:00Added an answer on May 22, 2026 at 2:39 am

    As zenob said this can be solved by a custom layout. Preference layout defined in the framework is used in the application:

    custom_preferece_layout.xml

    <?xml version="1.0" encoding="utf-8"?>
    <!-- Copyright (C) 2006 The Android Open Source Project Licensed under the 
        Apache License, Version 2.0 (the "License"); you may not use this file except 
        in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
        Unless required by applicable law or agreed to in writing, software distributed 
        under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 
        OR CONDITIONS OF ANY KIND, either express or implied. See the License for 
        the specific language governing permissions and limitations under the License. -->
    
    <!-- Layout for a Preference in a PreferenceActivity. The Preference is able 
        to place a specific widget for its particular type in the "widget_frame" 
        layout. -->
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent" android:layout_height="wrap_content"
        android:minHeight="?android:attr/listPreferredItemHeight"
        android:gravity="center_vertical" android:paddingRight="?android:attr/scrollbarSize">
    
        <RelativeLayout android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:layout_marginLeft="15dip"
            android:layout_marginRight="6dip" android:layout_marginTop="6dip"
            android:layout_marginBottom="6dip" android:layout_weight="1">
    
            <TextView android:id="@+android:id/title"
                android:layout_width="wrap_content" android:layout_height="wrap_content"
                android:singleLine="true" android:textAppearance="?android:attr/textAppearanceLarge"
                android:ellipsize="marquee" android:fadingEdge="horizontal"
                android:textColor="#FF0000" />
    
            <TextView android:id="@+android:id/summary"
                android:layout_width="wrap_content" android:layout_height="wrap_content"
                android:layout_below="@android:id/title" android:layout_alignLeft="@android:id/title"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:maxLines="4" />
    
        </RelativeLayout>
    
        <!-- Preference should place its actual preference widget here. -->
        <LinearLayout android:id="@+android:id/widget_frame"
            android:layout_width="wrap_content" android:layout_height="match_parent"
            android:gravity="center_vertical" android:orientation="vertical" />
    
    </LinearLayout>
    

    textColor attribute is defined for title TextView in the above layout. Use this layout with the checkbox preference in preference xml.

    mypreference.xml

    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
        <CheckBoxPreference android:key="testcheckbox"
        android:title="Checkbox Title"
        android:summary="Checkbox Summary..."
        android:layout="@layout/custom_preference_layout"></CheckBoxPreference>
    </PreferenceScreen>
    

    Checkbox preference title will have the color defined in the custom layout.

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

Sidebar

Related Questions

Is it possible to change the background color and the title text of compiled
I want to change the color of the title bar dynamically, ie: someone clicks
I have gone through this to change the color of my title bar. I'm
How can i change the window title color of a Window. I want to
As the title explains, I wish to change the color of a row when
I'd like to change the color of the java titlebar and add some text
In my seTabColor() I'm setting the color of the title text to Gray. I
I only want to change the colour for the title text, I dont know
Hello everyone I'm trying to do change text color in my controller. Yes I
In my android application I want the standard/basic title bar to change color. To

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.