1
我有一个通过xml设计的圆形进度条。问题是,如果我将layout_width和layout_height设置为wrap_content,它将切断圆圈。如果我手动将宽度和高度设置为“__dp”,那么圆周边会有一个巨大的框,它会扩大太多。为了更清楚地解释,我的进度条在你触摸它时开始。但是,即使您触摸了进度条旁边的边框,它也会启动(当不应该时)。我怎样才能删除这个边界?谢谢!Android,移除圆形进度条周围的方形边框
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:id="@+id/progressBar"
android:layout_width="200dp"
android:layout_height="200dp"
android:indeterminate="false"
android:progressDrawable="@drawable/circular_progress_bar"
android:background="@drawable/circle_shape"
android:max="100"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
/>
circle_shape.xml
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadiusRatio="7"
android:thickness="5dp"
android:useLevel="false">
<solid android:color="#CCC" />
</shape>
circular_progress_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="270"
android:toDegrees="270">
<shape
android:innerRadiusRatio="7"
android:shape="ring"
android:thickness="5dp"
android:useLevel="true">
<gradient
android:angle="0"
android:endColor="#007DD6"
android:startColor="#007DD6"
android:type="sweep"
android:useLevel="false" />
</shape>
</rotate>
如果我这样做,它周围仍然有一个盒子。 – Jill
你可以发布你正在使用的两个drawable吗 – FWeigl
当然,我把它添加到问题 – Jill