réaliser un textView sous forme d'un rectangle radius
salut je veux réaliser un textView sous forme d'un rectangle radius mais ça ne marche pas
j'ai déjà essayer avec ça:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
//res/drawable/mstyle.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#FFFF0000"
android:endColor="#80FF00FF"
android:angle="45"/>
<padding android:left="7dp"
android:top="7dp"
android:right="7dp"
android:bottom="7dp" />
<corners android:radius="8dp" />
</shape>
</selector> |
Code:
1 2 3 4 5 6 7 8 9 10
|
//mon layout
<TextView
android:id="@+id/textview"
android:layout_width="65dp"
android:layout_height="65dp"
android:text="1"
android:gravity="center"
android:background="@drawable/mstyle"
/> |
sachant que quant j’essaie de récupérer le ressource drawable dans le programme java me dit que min sdk pour cette instruction est 16 et moi je travaille avec sdk 15
et Merci