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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:27:07+00:00 2026-06-09T11:27:07+00:00

Possible Duplicate: Change icons of checked and unchecked for Checkbox for Android customize check

  • 0

Possible Duplicate:
Change icons of checked and unchecked for Checkbox for Android
customize check box preference

Is there any way to customize style of elements in PreferencesActivity?

I was only able to change color text, background etc.

I want to also change the check mark and radio button style in CheckBoxPreference and so on.

I’m interesting in API8 or greater.

Thanks for your help!

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
    <CheckBoxPreference
        android:defaultValue="true"
        android:key="vibrate"
        android:summary="summary"
        android:title="Some title"
        android:widgetLayout="@layout/custom_checkbox" />
    <CheckBoxPreference
        android:defaultValue="true"
        android:key="autorotate"
        android:summary="summary"
        android:title="auto rotate" />
</PreferenceScreen>
  • 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-06-09T11:27:08+00:00Added an answer on June 9, 2026 at 11:27 am

    I understand what you are saying now. I thought you were just using normal CheckBox inside your View. You are using CheckBoxPreference and the other Preference Views.

    Ok, well the concept is very similar.

    You need to define a custom widget layout. Do this in your res/layout directory and call it custom_checkbox.xml. We can use the CheckBox as an example.

    Define how you would like the CheckBoxPreference to look with the custom widget layout you create in the res/layout directory by using a CheckBox. For instance:

    <CheckBox
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+android:id/customCheckBox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:button="@drawable/android_button"
        android:clickable="false"
        android:focusable="false" />
    

    You can replace android:button with any drawable that you have found or designed.

    Now you need to define your CheckBoxPreference and setting its android:widgetLayout to the custom CheckBox you just defined in res/layout. For example:

    <CheckBoxPreference
        android:defaultValue="true"
        android:key="@string/Drop_Option"
        android:title="Close after call drop"
        android:widgetLayout="@layout/custom_checkbox" />
    

    If you are not using xml for defining your layout you can do it in code like this:

        CheckBoxPreference checkBoxPreference = new CheckBoxPreference(this);
        checkBoxPreference.setWidgetLayoutResource(R.layout.custom_checkbox);
    

    Resources found that were similar to this question.

    Konstantin Burov


    Related links to extended questions from comments:

    Also, how to change style of list item?

    android-listview-style

    Also, I would like to add some paddings to list items.

    spacing-between-listview-items-android

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

Sidebar

Related Questions

Possible Duplicate: how to change position of Toast in android? Is there any method
Possible Duplicate: Is there an easy way to change the color of a bullet
Possible Duplicate: change layout and template in zend dynamically according to the device(android tab,iphone,ipad)
Possible Duplicate: ToggleButton state change programmatically rather than automatically in Android? I am trying
Possible Duplicate: Flip-Animation for Activity-Change I'm new to Android Animation . I wanted to
Possible Duplicate: Android Button: set onClick background image change with XML? I need that
Possible Duplicate: Change Notification with Sql Server 2008 Am just wondering is there's anyway
Possible Duplicate: Change the native confirm/alert alert(hello) Is there anyway to change the style
Possible Duplicate: Change language programatically in Android I would like to develop an Android
Possible Duplicate: how to change the font on the text view in android? I

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.