Friday, November 06, 2009

Android fun :)

Today was playing with all kinds of UI controls customizations. One thing I needed to do is to be able to draw the background shape around image where only right top and bottom corners are rounded.
After some research and trying different things (because that part of APIs pretty much missing any documentation), I found out that it looks like the left and right is messed up in the API. Here is what works :

<corners android:bottomRightRadius="0.1dp" android:topRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:topLeftRadius="0.1dp" />

As you can see I had to use the bottom left radius to make the right corner round and for the rest of the corners I had to use 0.1dp , because 0dp just didn't work and made all corners not rounded.

Good luck ! :)

No comments: