- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想实现一个类似这样的进度条:
在 Material 设计中documentation它说我需要设置indeterminateAnimationType
至contiguous
实现这一点并提供三种颜色。但是如何提供三种颜色时indicatorColor
属性只接受一种颜色?
当我运行这段代码时,它会抛出一个异常 Contiguous indeterminate animation must be used with 3 or more indicator colors
:
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
app:indeterminateAnimationType="contiguous"
app:hideAnimationBehavior="outward"
app:showAnimationBehavior="inward"
app:trackThickness="5dp" />
最佳答案
使用连续动画至少需要 3 种指示器颜色。
只需使用 indicatorColor
带有数组的属性:
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress"
android:indeterminate="true"
app:indeterminateAnimationType="contiguous"
app:indicatorColor="@array/progress_colors"
../>
与
array/progress_colors
:
<integer-array name="progress_colors">
<item>@color/....</item>
<item>@color/....</item>
<item>@color/....</item>
</integer-array>
关于android - 如何在android中使用 Material 设计制作多色不确定线性进度指示器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67241052/
我想要一种不同的方式来创建多色 JLabel。(多色 = 不同前景色的文本部分) 到目前为止我找到的唯一解决方案(也是我目前使用的)是在 html 中设置文本。但是我遇到了问题... 当 Layout
是否可以在 UILabel 中创建多色文本?即,如果我的文字是: “敏捷的棕色狐狸” q 和 b 为蓝色,其余文本为黑色? 我感觉我必须使用 UIWebView 并以 HTML 形式呈现文本才能完成此
我想在我的 Richtextbox 多色中制作一行文本。我尝试了网络上提供的各种实现,并阅读了 SelectedText 和其他主题,但似乎无法让它按照我想要的方式工作。 这是我到目前为止所拥有的 R
我想做的是在导航栏中获得多种颜色?当前栏如图所示 导航栏 标志 导航栏 除了我似乎只能得到一种颜色 这是我目前拥有的代码的链接:http://jsfiddle.net/ju47nkgu/
我想渲染一行文本,其中一些单词以不同的颜色突出显示。 理想情况下,我会使用带有反应的跨度标签来完成此操作。 想知道如何使用 React-native 做同样的事情? 最佳答案 您可以通过使用嵌套文本组
Google map 标记可以采用复杂的 svg 路径作为其图标,如下所示: var baseSvg = { x1 : "m 0,0 l45,0 l 190,225 l -45,0 l -19
在我的应用程序中,我在里面实现了一个 SwiftyCharts,我需要根据 JSON 值中的性别选择显示多种颜色。在我的例子中,我得到了一个值来自 json,仅返回多种颜色。但是我无法显示任何人都可以
我正在编写并行代码来枚举大量 CSV 文件,每个文件都包含历史股票数据(超过 6500 个代码),并计算每只股票是否已达到历史最高点。 我已经实现了一个线程池和 TThread 后代类,以在线程之间平
我是一名优秀的程序员,十分优秀!