我使用的 Picker 没有选择,在 iOS15 中它工作正常,但在 iOS16 中它有一个默认值,我如何删除这个默认值,我不需要在 Picker 行右侧显示文本当选择为零时。
struct ContentView: View {
@State private var selection: String?
let strengths = ["Mild", "Medium", "Mature"]
var body: some View {
NavigationView {
List {
Section {
Picker("Strength", selection: $selection) {
ForEach(strengths, id: \.self) {
Text($0).tag(Optional($0))
}
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
在我的 flutter 中,我创建了一个 TextFormField,但它的键盘颜色在 iOS 中是黑色的,我想知道如何将其更改为白色。
颤振语言版本:>=2.2.2 <3.0.0
这是我关于 TextFormField 的代码:
TextFormField(
style: TextStyle(
fontSize: 14,
color: Colors.black),
autofocus: false,
initialValue: 'initial value',
maxLines: 1,
// onSaved: (String value) => _person = value,
// obscureText: _isObscure,
validator: (String value) {
if (value.isEmpty) {
return 'nononono';
}
return null;
},
decoration: InputDecoration(
hintText: 'please make sure',
contentPadding: EdgeInsets.fromLTRB(15, 5, 15, 5),
hintStyle: TextStyle(
color: Colors.grey,
fontSize: 12,
),
hasFloatingPlaceholder: false,
// contentPadding: contentPadding,
border: InputBorder.none,
),
),
Run Code Online (Sandbox Code Playgroud)
当我单击此 TextFormField 时
我得到的是:黑色键盘 …