我使用这个慢吞吞\循环devadvance创建了一个半圆形进度条,当我从调色板中选择那个自定义视图时,它看起来是这样的。

。
在这里,我有两个相对的布局与重量。包含进度条的布局的权重为2,底部的权重为3,并将进度条的布局宽度和高度设置为包装内容。
所以我的问题是为什么当从调色板中选择的时候进度条看起来是这样的呢?是因为画布的尺寸有完美的方格吗?我想要的是半圆形进度条完全被这样的布局所包围。

任何关于这方面的灯光都是非常感谢的。
编辑 xml代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_parent_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true">
<include layout="@layout/toolbar"/>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3">
<LinearLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout xmlns:app = "http://schemas.android.com/apk/res-auto"
android:id ="@+id/calorie_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:clickable="true">
<com.devadvance.circularseekbar.CircularSeekBar
android:id="@+id/calorie_progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:start_angle = "180"
app:end_angle = "0"
app:progress = "25"
app:circle_x_radius="200"
app:circle_y_radius="200"
app:circle_stroke_width = "30"
app:use_custom_radii="true"
app:circle_color ="#FFFACD"
android:layout_alignParentEnd="false"
android:layout_alignParentStart="false"
android:layout_centerInParent="true" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/exercise_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/calorie_label"
android:id="@+id/textView"
android:layout_marginBottom="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="20dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_alignBottom="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="50dp"
android:layout_marginStart="50dp"
android:contentDescription="@string/exercise_image" />
</RelativeLayout>
</LinearLayout>
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#999"/>
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
发布于 2015-12-13 23:01:22
问题是你的帆布高度。你有一个圆的高度,你在上面画了一半的圆圈。试试这个:ArcProgressBar --它有您需要的东西,您可以很容易地根据您的需要定制https://github.com/natasam/DemoProgressViewsLibApp。高度是弧形的高度,而不是像你这样的完整的圆。你也可以设置填充,边距,宽度,你想要的。
发布于 2015-01-06 11:16:00
加上这个
android:layout_height="0dp"对此
android:layout_height="match_parent" 用于添加权重属性的相对布局。
为
android:id="@+id/exercise_frame"
android:id ="@+id/calorie_frame"ids更改height="0dp"
希望它能成功..。
发布于 2015-01-15 06:28:40
我仍然没有找到发生的原因,如所示,但我的猜测是,它应该是那样的工作。无论如何,我用这个lzyzsd/循环进展替换了它,它对于我的用例来说非常好。
类似的令人敬畏的东西可以在这里找到安卓-武器库
https://stackoverflow.com/questions/27796721
复制相似问题