带有环形绘图的ProgressBar显示为一条线

时间:2016-02-18 15:34:39

标签: android layout

编辑:我的错误非常愚蠢,抱歉。我使用<div class="form-group" *ngIf="model"> <label for="name">Name</label> <input type="text" class="form-control" required [(ngModel)]="model.name" ngControl="name" #name="ngForm"> <div [hidden]="name.valid || name.pristine" class="alert alert-danger"> Name is required </div> </div> 前缀代替tools,因此我在运行时实际上并未设置android。当android中出现问题时,我只是变得偏执...

我需要在灰色圆圈(作为占位符)的顶部有一个红色进度圆,两者都在图像周围。

红色进度圆正确显示,但灰色圆圈显示为水平红线。

enter image description here

这很奇怪,因为如果单独绘制每个圆圈都会正确显示,但是当我同时想要两个圆圈时,其中一个圆圈就会被打破。

这是布局:

progressDrawable

圆圈抽签:

<FrameLayout
    android:layout_width="@dimen/icon_size"
    android:layout_height="@dimen/icon_size">

    <ImageView
        android:id="@+id/icon"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="13dp"
        android:layout_gravity="center"/>

    <!-- TODO: appears as a line, why? -->
    <ProgressBar
        android:id="@+id/progress_bg"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:max="1"
        android:progress="1"
        tools:progressDrawable="@drawable/circle_grey" />

    <ProgressBar
        android:id="@+id/progress"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:max="100"
        android:progress="70"
        android:progressDrawable="@drawable/circle_red" />

</FrameLayout>

有人可以帮忙吗?

感谢。

0 个答案:

没有答案
相关问题