我尝试将字体颜色设置为黑色而我不能,我将非常感谢您的帮助:
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
backgroundColor : "#ffffff",
exitOnClose: true,
layout: 'vertical'
});
var picker = Ti.UI.createPicker({
borderWidth : 1,
borderColor : "gray",
color : "black",
borderRadius : 5,
width : "90%",
top:50
});
var data = [];
data[0]=Ti.UI.createPickerRow({title:'El Salvador'});
data[1]=Ti.UI.createPickerRow({title:'Guatemala'});
data[2]=Ti.UI.createPickerRow({title:'Honduras'});
data[3]=Ti.UI.createPickerRow({title:'Nicaragua'});
data[4]=Ti.UI.createPickerRow({title:'Costa Rica'});
picker.add(data);
picker.selectionIndicator = true;
win.add(picker);
win.open();
//必须在选择器显示之后 picker.setSelectedRow(0,2,false);
答案 0 :(得分:3)
您可以在Label
PickerRow
标记
<Picker >
<PickerColumn id="column1">
<PickerRow >
<Label color="#0000" > Blah Blah </Label>
</PickerRow>
</PickerColumn>
</Picker>
答案 1 :(得分:2)
在/platform/android/res/values/themes.xml
中创建themes.xml<resources>
<style name="LightTheme" parent="@style/Theme.AppCompat.Light">
<item name="android:spinnerDropDownItemStyle">@style/mySpinnerItemStyle</item>
<item name="android:spinnerItemStyle">@style/mySpinnerItem</item>
</style>
<style name="mySpinnerItemStyle" parent="@android:style/Widget.Holo.DropDownItem.Spinner">
<item name="android:textColor">#000</item>
<item name="android:background">#d0d0d0</item>
</style>
<style name="mySpinnerItem" parent="@android:style/Widget.TextView.SpinnerItem">
<item name="android:textColor">#000</item>
</style>
</resources>
答案 2 :(得分:2)
如果您尝试实施5.2版本中的增强功能,那么文档说如果选择器是一种时间或日期时间,则只能更改颜色。 https://jira.appcelerator.org/browse/TIMOB-16547
但Abada使用标签的方法效果很好。