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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:59:06+00:00 2026-06-09T16:59:06+00:00

I have a problem applying a theme to my buttons. without using the theme

  • 0

I have a problem applying a theme to my buttons. without using the theme everything looks fine as you can see on this screenshot:
http://i47.tinypic.com/2czyctv.jpg

after I have applied my theme it looks like this:
http://i48.tinypic.com/w03s6x.png

the color is fine, but the height of the button is wrong and also the space between the upper button and the horizontal line disappeared. actually the themed buttons should look like the unthemed buttons for their size because the only thing i wanted to change was the color.

values/themes.xml:

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

<style name="Theme.KIT.Styled" parent="Theme.Sherlock.Light.DarkActionBar">

    <item name="actionBarStyle">@style/ActionBar</item>
    <item name="android:actionBarStyle">@style/ActionBar</item>
    <item name="android:buttonStyle">@style/Button</item>

</style>

<style name="ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="background">@drawable/actionbar_background_shape</item>
    <item name="android:background">@drawable/actionbar_background_shape</item>
</style>

<style name="Button" parent="@android:style/Widget.Button">
    <item name="android:background">@drawable/kit_button</item>
</style>
</resources>

drawable/kit_button.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
    android:state_enabled="false"
    android:drawable="@drawable/kit_button_background_shape" />
<item
    android:state_pressed="true"
    android:state_enabled="true"
    android:drawable="@drawable/kit_button_background_shape" />
<item
    android:state_focused="true"
    android:state_enabled="true"
    android:drawable="@drawable/kit_button_background_shape" />
<item
    android:state_enabled="true"
    android:drawable="@drawable/kit_button_background_shape" />
</selector>

drawable/kit_button_background_shape.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient 
    android:startColor="@color/KIT_GREEN"
    android:endColor="@color/KIT_GREEN_LIGHT"
    android:angle="90"
    android:centerX="0.5"
    android:centerY="0.5" />
</shape>

i hope s.o. can help me. and sorry for my bad english…

  • 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-09T16:59:07+00:00Added an answer on June 9, 2026 at 4:59 pm

    Your buttons padding used to be declared within the 9-patch background, a GradientDrawable doesn’t do that for you. You need to add a android:padding attribute to your theme or use a 9-patch.

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

Sidebar

Related Questions

I have problem with my query on C, I’m using the oci8 driver. This
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar
I have a problem with an image that I am applying a custom jquery
We have started using Wijmo (based on the jQuery UI & jQuery UI Theme
[SOLVED]: Applying proper list iteration procedure fixed problem. (Shown below) I currently have a
I have a problem asked to me in an interview, this is a similar
I currently have an ImageView which i am applying a scale animation to. This
I have a problem here. I've tried searching everywhere but can't seems to find
I have a java program that launches a program on start up. This can
I have a problem with JQuery applying on JSF datatable. I have my code

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.