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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:48:49+00:00 2026-06-11T11:48:49+00:00

I just integrated ActionBar into my Android app (actually, I ultimately went with ActionBarSherlock

  • 0

I just integrated ActionBar into my Android app (actually, I ultimately went with ActionBarSherlock for its backward compatibility).

To display the ActionBar on an activity, you must use a particular set of themes: Theme.Holo.* for ActionBar or Theme.Sherlock.* for ActionBarSherlock

Whenever I modify the AndroidManifest.xml so that the style of an existing activity uses one of the aforementioned ActionBar themes, I find that the background image of each Button on the activity becomes distorted. Specifically, the image gets stretched vertically across more pixels than the image actually contains. I would expect that behavior only if I was using layout_height=”fill_parent”, but I am not. Furthermore, this doesn’t seem to happen with other themes (other than the ActionBar-related themes).

I tried posting screenshots, but I don’t have a high enough reputation yet. I apologize.

Here is one of my Button declarations that is being affected adversely by the Theme:

<Button
    android:textStyle="bold"
    android:typeface="sans"
    android:layout_height="wrap_content"
    android:id="@+id/btnAddtoBag" android:layout_width="wrap_content"
    android:background="@drawable/add_to_bag_selector">
</Button>

Since that references a selector, I will include the XML of the selector also, where the actual png files are referenced:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
          android:drawable="@drawable/selected_add_to_bag" /> <!-- pressed -->
    <item android:state_focused="true"
          android:drawable="@drawable/selected_add_to_bag" /> <!-- focussed -->
    <item android:drawable="@drawable/default_add_to_bag" /> <!-- default -->
</selector>

Finally, here is the style that I’m applying to my theme when this happens:

<style name="Theme.CustomActionBar" parent="Theme.Sherlock.Light.DarkActionBar.ForceOverflow">
    <item name="actionBarStyle">@style/ActionBar</item>
</style>

<style name="ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="android:displayOptions">showHome|useLogo</item>
    <item name="displayOptions">showHome|useLogo</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-06-11T11:48:50+00:00Added an answer on June 11, 2026 at 11:48 am

    use ImageButton and set the android:src=”@drawable/add_to_bag_selector” and your image shouldn’t be stretched.

    you will also need to set the android:backgorund=”@android/color/transparent”

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

Sidebar

Related Questions

I just integrated the Apple's In-App purchase into my application with 4 products. It
I have just integrated AdWhirl into my app. I have the AdWhirl view set
i have just integrated iAd into my app. I have strange revenue for big
I successfully integrated iAd into my iPhone app. However, I can't find a way
I've integrated ActiveMerchant into my Rails 3 app more or less along the lines
I've just integrated pentaho's design studio into the BI server. Does anyone know how
This all is driving me nuts. I just integrated facebook in my iphone app.
So, I just integrated AdMob into my application. Now, I'm wondering whether to place
My project has just integrated Jenkins as its CI server. We would love to
I've just run into one of the problems of using the integrated dev server

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.