使用下面代码显示一个两列的选择器控件,设置了每一行的高度为88,但是看图片并不是设置的一样,请问该如何设置才能达到每一行的高度是88的效果,并且最上和最下两行完全显示在页面中?
TextPicker({ range: this.multiArray, selected: this.selected })
.onChange((value: string | string[], index: number | number[]) => {
console.info('testTag Picker item changed, value: ' + value + ', index: ' + index)
})
.width('100%')// .height(fixedPx2Vp(440))
.defaultPickerItemHeight(fixedPx2Vp(88))
.disappearTextStyle({
color: '#A5A5A5',
font: {
size: fixedFontSize2Vp(32)
}
})
.textStyle({
color: '#A5A5A5',
font: {
size: fixedFontSize2Vp(32)
}
})
.selectedTextStyle({
color: '#222222',
font: {
size: fixedFontSize2Vp(32)
}
})
.canLoop(this.canLoop)
解决方案:
这里的每一项直接默认是有一定间隙的,看起来其他项会比选中项要高一些。