小编arp*_*rps的帖子

文本视图与圆形背景

我希望我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 android

13
推荐指数
2
解决办法
2万
查看次数

错误:(3)解析XML时出错:格式错误(无效令牌)

这是我的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)

xml android

6
推荐指数
1
解决办法
266
查看次数

标签 统计

android ×2

xml ×2