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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:57:11+00:00 2026-05-27T21:57:11+00:00

I have a view to which I want to set a drawable image which

  • 0

I have a view to which I want to set a drawable image which is very easy. the images is set properly but the corners are square. If I try to make the corners rounded by using shape attribute in an xml drawable then the corners are round but I cannot find a way to set the image background as the background attribute of the view is used to set the xml drawable for corner.

Is there a way to have the background as an image as well as rounded corners. I am aware of solutions like using an image with rounded corners but I don’t want to bother the graphics team for such smaller issues and I want to have a generic solution.

Thanks a lot for your help.

  • 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-27T21:57:12+00:00Added an answer on May 27, 2026 at 9:57 pm

    Override the dispatchDraw method of your view(or onDraw in case it’s not a view hierarchy)

    private final Path mClipPath;
    .......
    mClipPath = new Path();
    mClipPath.addRoundRect(new RectF(x,y,z,t),radius,radius,Direction.CW);
    ........
    @Override
    protected void dispatchDraw(final Canvas canvas){
        canvas.clipPath(mClipPath); // clip the canvas so that we can draw only in the boundaries specified by mClipPath
        super.dispatchDraw(canvas); //now draw the view on the clipped canvas
        .....  //do other drawing
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to set an image to have a transparent background, but I do
I have a navigation controller which also has a table view. I want to
i have a view in which i have tabel view and i want to
Hi i want to set different images to each row of a listview which
I have a view which is containing 5 forms submitting separately but to the
I have a table view which I want to bring up in edit mode
I have a set of data which I want to display to the user
I have a strongly typed MVC3 Razor view in which I want to display
I have a custom view (android) which draws a custom progress bar. I want
i have text View in layout and set text in layout..now i want to

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.