// xxx.ets
@Entry
@Component
struct MouseEventExample {
@State hoverText: string = ‘no hover’
@State mouseText: string = ‘MouseText’
@State changevalue: string = ‘’
@State submitvalue: string = ‘’
@State color: Color = Color.Blue
@State text: string = ‘’
controller: SearchController = new SearchController()
build() {
Column({ space:20 }) {
Search({value: ‘’, placeholder: ‘Type to search’, controller: this.controller})
.searchButton(‘Search’)
.width(‘100%’)
.height(35)
.backgroundColor(Color.White)
.placeholderColor(Color.Grey)
.placeholderFont({ size: 20, weight: 10, family: ‘serif’, style: FontStyle.Normal })
.onSubmit((value: string) => {
this.submitvalue = value
})
.onChange((value: string) => {
this.changevalue = value
})
.margin({ top: 30 })
Text(‘This is the setting of textOverflow to none text content This is the setting of textOverflow to none text content.’)
.textOverflow({ overflow: TextOverflow.None })
.fontSize(12).border({ width: 1 }).padding(10)
TextInput({ placeholder: 'input your word' })
.placeholderColor("rgb(0,0,225)")
.placeholderFont({ size: 30, weight: 100, family: 'cursive', style: FontStyle.Italic })
.caretColor(Color.Blue)
.height(50)
.fontSize(30)
.fontWeight(FontWeight.Bold)
.fontFamily("sans-serif")
.fontStyle(FontStyle.Normal)
.fontColor(Color.Red)
.onChange((value: string) => {
this.text = value
})
Hyperlink('https://ost.51cto.com/person/posts/15589203', '鸿蒙开发之南拳北腿') { // Hyperlink接口
Text('鸿蒙开发ArkUI最佳实践')
.fontSize(20)
.fontWeight(Number(FontWeight.Bold))
.borderColor(Color.Orange)
.borderWidth(1)
}.color(Color.Orange)
RowSplit() {
Text('1').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
Text('2').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
Text('3').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
Text('4').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
Text('5').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
}
.resizeable(true) // 可拖动
.width(300).height(100).borderWidth(1).borderColor(Color.Black).align(Alignment.Start)
ColumnSplit() {
Text('1').width('100%').height(40).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
Text('2').width('100%').height(40).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
Text('3').width('100%').height(40).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
Text('4').width('100%').height(40).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
Text('5').width('100%').height(40).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
}
.resizeable(true)
.width(300).height(300).borderWidth(1).borderColor(Color.Black).align(Alignment.Top)
}.padding({ top: 20 }).width('100%')
}
}
/*
// xxx.ets
@Entry
@Component
struct TextInputExample1 {
build() {
Column() {
TextInput({ placeholder: ‘input your word’ })
.placeholderColor(“rgb(0,0,225)”)
.placeholderFont({ size: 30, weight: 100, family: ‘cursive’, style: FontStyle.Italic })
.caretColor(Color.Blue)
.height(50)
.fontSize(30)
.fontWeight(FontWeight.Bold)
.fontFamily(“sans-serif”)
.fontStyle(FontStyle.Normal)
.fontColor(Color.Red)
.onChange((value: string) => {
this.text = value
})
Text(this.text).width(‘90%’)
}
}
}
*/