I have next XML drawable blue_button
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<layer-list>
<item><bitmap android:src="@drawable/button_blue_bg" />
</item>
<item >
<shape>
<corners android:radius="50dip" />
<stroke android:width="1dip" android:color="#ccffffff" />
<solid android:color="#00000000" />
<padding android:bottom="3dip"
android:left="3dip"
android:right="3dip"
android:top="3dip" />
</shape>
</item>
</layer-list>
</item>
</selector>
And i have image button_blue_bg with gradient with 1px width.
When i set button background i get next image

As you can see i have background not clipped with rounded border.
How i need modificate xml for background gradient image be not outside border?
I understand why it happended, because i use layers – so this like sandwich- but i also programming on objective c, and there it’s also use layers. But in Apple it’s wotks fine.
i use this…. First a Layer for the basic definition, set this layer as backgound of your layout:
i use this function for making round corners:
and finaly, the code in the activity: