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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:42:35+00:00 2026-06-08T13:42:35+00:00

I want to flip image for button’s background in xml. I’ve seen example how

  • 0

I want to flip image for button’s background in xml. I’ve seen example how to do it, but it was programmatically way: http://xjaphx.wordpress.com/2011/06/26/image-processing-image-flipping-mirroring.
Anyway, I have a xml file (button_left_state.xml) like below :

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">  
<item android:state_pressed="true" >
    <rotate android:fromDegrees="180.0" android:toDegrees="180.0" 
    android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/buttonrightpressed" />    
</item>    

<item>
  <rotate android:fromDegrees="180.0" android:toDegrees="0.0" 
    android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/buttonright"/>
</item>   
</selector>

But this code just rotate image to 180 degrees.
Is it possible to flip image in xml?

  • 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-08T13:42:37+00:00Added an answer on June 8, 2026 at 1:42 pm

    I resolve my problem by using layer-list:

    <selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item >
            <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
                <item>
                    <shape android:shape="rectangle">
                        <gradient android:startColor="#9f9" android:centerColor="#000"
                            android:endColor="#0f0" android:angle="-90" />
                        <stroke android:width="1.0px" android:color="#444" />
                        <corners android:bottomRightRadius="7dip"
                            android:bottomLeftRadius="0.1dp"
                            android:topLeftRadius="0.1dp"
                            android:topRightRadius="7dip"/>
                    </shape>
                </item>
                <item>
                    <rotate android:fromDegrees="180.0" android:toDegrees="180.0"
                        android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/arrow_right" />
                </item>
            </layer-list>
        </item>
    </selector>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to take an image in flip it upside down with html canvas.
I want to hide an image after one second, as a flip animation ends.
I'm trying to resize an image in pygame. I want my background image to
I have two layouts(xml files) and I want to flip from one page to
I want to flip an imageView (left/right), but I can not find a UIView
In My application i want to flip the view.. I have seen such animation
I want to include Flip view in my project. I made it like this
Want to run javascript function from parent window in child window Example I have
want to have a Hyperlink-Button in a gridView in which I can display a
Want the function to sort the table by HP but if duplicate HPs then

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.