Java Android,移除圆形进度条周围的方形边框
我有一个通过xml设计的循环进度条。问题是,如果我将layout_width和layout_height设置为wrap_content,它将切掉圆。如果我手动将宽度和高度设置为“uu dp”,那么圆周围会有一个巨大的框,它会扩展得太多。为了更清楚地解释,我的进度条会在你触摸它时启动。但是,如果它周围有这个边框,即使您触摸进度条旁边,它也会启动(当它不应该启动时)。如何删除此边界?谢谢Java Android,移除圆形进度条周围的方形边框,java,android,xml,Java,Android,Xml,我有一个通过xml设计的循环进度条。问题是,如果我将layout_width和layout_height设置为wrap_content,它将切掉圆。如果我手动将宽度和高度设置为“uu dp”,那么圆周围会有一个巨大的框,它会扩展得太多。为了更清楚地解释,我的进度条会在你触摸它时启动。但是,如果它周围有这个边框,即使您触摸进度条旁边,它也会启动(当它不应该启动时)。如何删除此边界?谢谢 circle_shape.xml <?xml version="1.0" encoding="utf
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>
循环_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>
您设置了错误的样式
style="?android:attr/progressBarStyleHorizontal"
用于水平ProgressBar
s。删除样式或使用循环ProgressBar
s等样式
style="@style/Base.Widget.AppCompat.ProgressBar"
如果我这样做的话,它周围还有一个盒子。你能把你正在使用的两个抽屉贴在哪里吗?我确实把它添加到了问题中,你想要终止还是不确定进度条?确定进度条
style="@style/Base.Widget.AppCompat.ProgressBar"