我希望我TextView有圆形边框,并希望这个戒指充满红色.
card_text_border.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="10dp"
android:thickness="15dp"
android:useLevel="false"
android:shape="ring" >
<solid
android:color="@color/PrimaryDarkColor"/>
<stroke
android:width="4px"
android:color="#000000" />
</shape>
Run Code Online (Sandbox Code Playgroud)
这是我的 TextView
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="0"
android:id="@+id/txtView_cart"
android:paddingRight="10dp"
android:background="@drawable/card_text_border"
android:layout_gravity="top|right"/>
Run Code Online (Sandbox Code Playgroud) 这是我的xml文件,然后是anim文件夹.当我运行应用程序时,会显示解析错误.
shake.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
< translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXDelta="0%"
android:interpolator="@anim/cycle_7"
android:toXDelta="5%" />
</set>
Run Code Online (Sandbox Code Playgroud)
cycle_7.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
< cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="7" />
</set>
Run Code Online (Sandbox Code Playgroud)