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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:23:29+00:00 2026-05-30T15:23:29+00:00

What I try to do I’m trying to create a Backgroud-Shape for my App.

  • 0

What I try to do


I’m trying to create a Backgroud-Shape for my App. For This I created a gradient witch starts in the middle, but I want that it starts on the right side. You can imagine you this like the gradient comes in from the right side.

Question


What do I need to change in my Shape or Gradient that this works?

Code


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



    <gradient android:gravity="right" android:type="radial" android:gradientRadius="280"
        android:startColor="#FFFFFF" android:endColor="#CBCBCB" /><!--   #e0dede" -->
</shape>

Image


This how it looks at the moment!

enter image description here

Like you see the gradient is in the middle, I want that exactly this gradient starts from the right side into the middle of the screen.

  • 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-30T15:23:30+00:00Added an answer on May 30, 2026 at 3:23 pm

    Try this and see the magic:

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
    
        <gradient android:layout_gravity="right" android:type="radial" android:gradientRadius="280"
            android:centerX="100%" android:centerY="50%"
            android:startColor="#FFFFFF" android:endColor="#CBCBCB" /><!--   #e0dede" -->
    </shape>
    

    Tags android:centerX and android:centerY lets you start your gradient from any point on your screen.You just need to give related % values as i did here.It worked like magic for me!

    I didn’t change other tags settings of your code but you will have to change the radius as per how much white portion you need to make visible.

    Hope,It helped.

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

Sidebar

Related Questions

Try this little experiment. Create a file Foo.txt with a very long line of
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Try running this in a .VBS file MsgBox(545.14-544.94) You get a neat little answer
Try yourself : as example, try to retrieve the fields of this video :
Try to open my web-page on vds and then get: We're sorry, but something
Try as I might, I cannot get this to work. Here is my latest
Try this: Make a new XCode4 Applescript project. In the delegate, paste this code:
Try this: <div style=float:left><p>LEFT</p></div> <div style=float:right><p>RIGHT</p></div> <div><p> <input type=text style=width:100% /> <input type=submit />
Try this showcase: <!doctype html> <html> <head> <style> html { min-height: 100%; overflow-y: scroll;
Try to save them like this: HttpCookie latcook = new HttpCookie(latitude, lat.Value.ToString()); HttpCookie lngcook

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.