在上面的图像中,我想将-02:49
更改为颜色,例如Color.blue
我尝试过:
struct ContentView: View {
var body: some View {
PlayerView().accentColor(Color.blue)
}
}
我还尝试将其添加到实际的PlayerView中,方法如下:
struct PlayerView: View {
var body: some View {
VStack{
....
}.navigationBarTitle(Text(“-2:49”))
.accentColor(.blue)
}
}
我也尝试过:
struct PlayerView: View {
var body: some View {
VStack{
....
}.navigationBarTitle(Text(“-2:49”).foregroundColor(.blue))
}
}
colorMultiply
会将TextView更改为“some View”,因此我收到错误提示:参数类型“some View”不符合预期的类型“StringProtocol”
。 - 39fredy