Android: rounded corners work differently in different versions of Android

I have a problem with a corner tag.

This is my form file.

<stroke android:width="1dp" android:color="#ff999999" /> <size android:height="40dp" /> <gradient android:angle="90" android:centerColor="#f5f5f5" android:endColor="#fcfcfc" android:startColor="#efefef" android:type="linear" /> <corners android:bottomLeftRadius="0dip" android:bottomRightRadius="8dip" android:topLeftRadius="8dip" android:topRightRadius="0dip" /> 

But when I set it to represent the background. It displays a different form in Android 2.2 and Android 4.0.3. When it works on Android 4.0.3: works on Android 4.0.3 And on Android 2.2: works on Android 2.2

Please see the "AD" button. You know why? And how can I fix this? Please help me! Sorry because my english is not very good.

+6
source share
1 answer

This was a bug in SDK versions prior to API version 12 where the right and lower right right were canceled. What you can do (and there is more detailed information on this link ), create a res/drawable-v12 folder and copy these drawings into it using the radii change back (i.e. the lower left radius becomes the lower right radius and vice versa), and these drawings will be automatically selected for devices above API 12.

+13
source

Source: https://habr.com/ru/post/921506/


All Articles