提交 dc192e79 编写于 作者: T tengfan66

update textpicker

Signed-off-by: Ntengfan66 <tengfan3@huawei.com>
上级 66e09a17
...@@ -116,3 +116,27 @@ struct TextPickerExample { ...@@ -116,3 +116,27 @@ struct TextPickerExample {
``` ```
![textpicker](figures/textpicker.gif) ![textpicker](figures/textpicker.gif)
```ts
// xxx.ets
@Entry
@Component
struct TextPickerExample {
private select: number = 1
private fruits: string[] = ['apple1', 'orange2', 'peach3', 'grape4']
build() {
Column() {
TextPicker({ range: this.fruits, selected: this.select })
.onChange((value: string, index: number) => {
console.info('Picker item changed, value: ' + value + ', index: ' + index)
})
.disappearTextStyle({color: Color.Red, font: {size: 15, weight: FontWeight.Lighter}})
.textStyle({color: Color.Black, font: {size: 20, weight: FontWeight.Normal}})
.selectedTextStyle({color: Color.Blue, font: {size: 30, weight: FontWeight.Bolder}})
}.width('100%').height('100%')
}
}
```
![textpicker](figures/textpicker1.gif)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册