For API 21+, Use Clip ViewsRounded outline clipping was added to the View class in API 21. See this or this for more info.This in-built feature makes rounded corners very easy to implement. It works on any view or layout and supports proper clipping.Here's What To Do:. Create a rounded shape drawable and set it as your view's background:android:background='@drawable/roundoutline'. According to the documentation, then all you need to do is this: android:clipToOutline='true'Unfortunately, there seems to be and this XML attribute currently is not recognized. Luckily, we can set the clipping in Java:. In your activity or fragment: View.setClipToOutline(true)What It Looks Like:Special Note About ImageViewssetClipToOutline only works when the View's background is set to a shape drawable.
If this background shape exists, View treats the background's outline as the borders for clipping and shadowing purposes.This means that if you want to round the corners on an ImageView with setClipToOutline, your image must come from android:src instead of android:background (since background is used for the rounded shape). If you MUST use background to set your image instead of src, you can use this nested views workaround:.
Oct 12, 2008 It's strange. The moment I uninstall the 'imagecache canvasactions' module, the 'change file format' filter is visible but I don't see the 'rounded corners' action. When I reinstall 'imagecache canvasactions' the 'rounded corners' action becomes visible.
![Rounded Rounded](/uploads/1/2/5/4/125449009/541587495.jpg)
Create an outer layout with its background set to your shape drawable. Wrap that layout around your ImageView (with no padding). The ImageView (including anything else in the layout) will now be clipped to the outer layout's rounded shape. Here's a copy of a XML file to create a drawable with a white background, black border and rounded corners: save it as a xml file in the drawable directory,Use it like you would use any drawable background(icon or resource file) using its resource name (R.drawable.yourxmlname).
Use CardView in android v7 support library.Though it's a bit heavy, it solves all problem, and easy enough.Not like the set drawable background method, it could clip subviews successfully. A better way to do it would be:backgroundactivity.xml This will work below API 21 also, and give you something like this:If you are willing to make a little more effort more better control, then use android.support.v7.widget.CardView with its cardCornerRadius attribute (and set elevation attribute to 0dp to get rid of any accompanying drop shadow with the cardView). Also, this will work from API level as low as 15.
![Action Action](/uploads/1/2/5/4/125449009/584320730.jpg)
Journal cards are fun to add to any type of layout, whether you are making a pocket layout or not!If you are working with journal cards and are tired of straight edges, change things up by turning them into rounded edges! As simple as counting to three, this action will quickly and automatically round your corners! And read to the end to see how to get this action from my, for free!Check out the videos below: For Photoshop Element users:For Photoshop users:I have the action for you, as a free download:If you found this tutorial helpful, you can check out the other tutorials I offer on YouTube! You can also pin the image below to share with others! Thank you for visiting!And if you are brand new to digital scrapbooking and would like to take my FREE email course called From Newbie to Know How, click!