如何在Appcelerator Android中自定义选择器的大小?

时间:2018-12-01 13:14:35

标签: css appcelerator appcelerator-titanium appcelerator-mobile appcelerator-studio

enter image description here

我无法在视图中填充选择器的大小。我已经将pickerView的背景颜色属性应用为绿色。我已经为它们设置了以下属性。

index.tss:

"#pickerview":{
height:200,
left:0,
backgroundColor:"green",
right:0,
top:0,
}

1 个答案:

答案 0 :(得分:0)

尝试使用Titanium.UI.FILL作为宽度 “ #pickerview”:{ 左:0, 宽度:Titanium.UI.FILL, backgroundColor:“绿色”, 对:0, 最高:0, }

但是根据iOS接口指南,高度必须与键盘大小相同。

Appcelerator文档说-在iOS上,height属性仅在iOS 9和更高版本中可用。默认情况下,选择器的大小(包括其背景)固定为与iPhone键盘相同的高度,以遵守iOS人机界面指南。 iOS上的默认宽度为320px,高度为228px。选择器中内容的大小适合该选择器,这可能会切断选择器行中的文本。 iOS还支持将视图添加到选择器行。