xamarin形式的进度条色调颜色

问题描述 投票:0回答:1

有没有办法在xamarin表单中使用进度条更改默认的色调颜色。如果不是,我将如何为此创建一个机器人自定义渲染器。图片显示了一个滑块,但我正在寻找的是进度条中类似的东西。 enter image description here

xamarin.forms background background-color android-progressbar custom-renderer
1个回答
0
投票

不确定我是否正确,但如果你想改变ProgressBar背景颜色,你可以通过访问ProgressBar BackgroundColor属性在你的pcl项目上做到这一点,如下所示:

var progressBar = new ProgressBar
{
    BackgroundColor = Color.White
};

但是如果你想在Android平台上更改progressbar的tintcolor,一个简单的方法就是改变styles.xml colorAccent值。您可以通过评论查看:

colorAccent用作colorControlActivated的默认值,用于着色窗口小部件

© www.soinside.com 2019 - 2024. All rights reserved.