gpt4 book ai didi

ios - Swift UI - 轮选择器,更改对齐方式和字体大小

转载 作者:行者123 更新时间:2023-12-04 00:57:02 25 4
gpt4 key购买 nike

是否可以自定义轮子选择器字体并将对齐方式更改为 .leading ?

最佳答案

我认为这将是您所期望的。

struct ContentView: View {
let colors = ["Red", "Yellow", "Green", "Gray", "Black", "Purple", "White", "Brown", "Pink", "Blue"]
@State private var color = "Red"
var body: some View {
Picker(selection: $color, label: Text("")) {
ForEach(self.colors, id: \.self) { color in
HStack {
Text(color)
.font(.title)
.padding()
Spacer()
}
}
}
.pickerStyle(WheelPickerStyle())
.labelsHidden()
}
}

谢谢,X_X

关于ios - Swift UI - 轮选择器,更改对齐方式和字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61695562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com