Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对track设置半透明颜色,会start和end颜色会被影响 #13

Closed
tcqq opened this issue Dec 21, 2018 · 1 comment
Closed

对track设置半透明颜色,会start和end颜色会被影响 #13

tcqq opened this issue Dec 21, 2018 · 1 comment

Comments

@tcqq
Copy link

tcqq commented Dec 21, 2018

@Moosphan track设置半透明颜色,会影响start和end颜色.

如图:
image
image

@tcqq
Copy link
Author

tcqq commented Dec 21, 2018

我找到了一种轻松解决上述问题的方法。

        <ProgressBar
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="16dp"
            android:max="100"
            android:progress="45"
            android:progressDrawable="@drawable/curved_progress_bar" />

curved_progress_bar.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background">
        <shape>
            <corners android:radius="8dp" />
            <solid android:color="@color/progressbar_background_color_selector" />
        </shape>
    </item>

    <item
        android:id="@android:id/progress">

        <scale android:scaleWidth="100%">
            <shape>
                <corners android:radius="8dp" />
                <solid android:color="@color/review_filled_color" />
            </shape>
        </scale>
    </item>
</layer-list>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant