source
stringlengths
14
113
code
stringlengths
10
21.3k
application-dev\ui\arkts-common-components-progress-indicator.md
Progress({ value: 10, total: 150, type: ProgressType.Capsule }).width(100).height(50) Progress({ value: 20, total: 150, type: ProgressType.Capsule }).width(50).height(100).color(Color.Grey) Progress({ value: 50, total: 150, type: ProgressType.Capsule }).width(50).height(100).color(Color.Blue).backgroundColor(Color....
application-dev\ui\arkts-common-components-progress-indicator.md
@Entry @Component struct ProgressCase1 { @State progressValue: number = 0 // Set the initial progress of the progress indicator to 0. build() { Column() { Column() { Progress({value:0, total:100, type:ProgressType.Capsule}).width(200).height(50).value(this.progressValue) Row().width('100%...
application-dev\ui\arkts-common-components-radio-button.md
Radio(options: {value: string, group: string})
application-dev\ui\arkts-common-components-radio-button.md
Radio({ value: 'Radio1', group: 'radioGroup' }) .checked(false) Radio({ value: 'Radio2', group: 'radioGroup' }) .checked(true)
application-dev\ui\arkts-common-components-radio-button.md
Radio({ value: 'Radio1', group: 'radioGroup' }) .onChange((isChecked: boolean) => { if(isChecked) { // Operation } }) Radio({ value: 'Radio2', group: 'radioGroup' }) .onChange((isChecked: boolean) => { if(isChecked) { // Operation } })
application-dev\ui\arkts-common-components-radio-button.md
// xxx.ets import { promptAction } from '@kit.ArkUI'; @Entry @Component struct RadioExample { @State Rst:promptAction.ShowToastOptions = {'message': 'Ringing mode.'} @State Vst:promptAction.ShowToastOptions = {'message': 'Vibration mode.'} @State Sst:promptAction.ShowToastOptions = {'message': 'Silent mode.'} ...
application-dev\ui\arkts-common-components-richeditor.md
controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller }; RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Create a RichEditor component without using a styled string.', { style: { fontColor: Color.Black, ...
application-dev\ui\arkts-common-components-richeditor.md
fontStyle: TextStyle = new TextStyle({ fontColor: Color.Pink }); // Define a text style object. mutableStyledString: MutableStyledString = new MutableStyledString("Create a RichEditor component using a styled string.", [{ start: 0, length: 5, styledKey: StyledStringKey.FONT, styledValue: this.fontS...
application-dev\ui\arkts-common-components-richeditor.md
export interface SelectionMenuTheme { imageSize: number; buttonSize: number; menuSpacing: number; editorOptionMargin: number; expandedOptionPadding: number; defaultMenuWidth: number; imageFillColor: Resource; backGroundColor: Resource; iconBorderRadius: Resource; containerBorderRadius: Resource; c...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('The component has the color set for the caret and selection handle.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .caretColor(Color.Orange) .width(300) .height(300)
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .placeholder("Enter your content here", { fontColor: Color.Gray, font: { size: 15, weight: FontWeight.Normal, family: "HarmonyOS Sans", style: FontStyle.Normal } }) .width(300) .height(50)
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('The onReady callback content is preset text within the component.', { style: { fontColor: Color.Black, fontSize: 15 } }) })
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Select this text to invoke the onSelect callback.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .onSelect((value: RichEditorSelection) => { this.controller1.addTextSpan(JSON.stringify(value),...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('The callback is invoked before the text or image change.\nThe callback is invoked after the text or image change.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .onWillChange((value: RichEditorCha...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan(''The callback is invoked before content input in the input method.\nThe callback is invoked when text input in the input method is complete.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .aboutTo...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Copy and paste operations on this text trigger the corresponding callbacks.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .onPaste(() => { this.controller1.addTextSpan('The onPaste callback i...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Copy and paste operations on this text trigger the corresponding callbacks.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .onCut(() => { this.controller1.addTextSpan('The onCut callback is in...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Copy and paste operations on this text trigger the corresponding callbacks.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .onCopy(() => { this.controller1.addTextSpan('The onCopy callback is ...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Click the button to change the preset typing style.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .width(300) .height(60) Button('setTypingStyle', { buttonStyle: ButtonStyleMode.NORMAL }) ....
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Click the button to select the text at positions 0 to 2 here.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .width(300) .height(60) Button('setSelection(0,2)', { buttonStyle: ButtonStyleMode....
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Click the button to add text here.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .width(300) .height(100) Button('addTextSpan', { buttonStyle: ButtonStyleMode.NORMAL }) .height(30) .fontS...
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Click the button to add an image here.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .width(300) .height(100) Button('addImageSpan', { buttonStyle: ButtonStyleMode.NORMAL }) .height(30) ....
application-dev\ui\arkts-common-components-richeditor.md
private my_builder: CustomBuilder = undefined @Builder TextBuilder() { Row() { Image($r('app.media.startIcon')).width(50).height(50).margin(16) Column() { Text("Text.txt").fontWeight(FontWeight.Bold).fontSize(16) Text("123.45KB").fontColor('#8a8a8a').fontSize(12) }.alignItems(HorizontalAlign....
application-dev\ui\arkts-common-components-richeditor.md
RichEditor(this.options) .onReady(() => { this.controller.addTextSpan('Click the button to add a symbol here.', { style: { fontColor: Color.Black, fontSize: 15 } }) }) .width(300) .height(100) Button('addSymbolSpan', { buttonStyle: ButtonStyleMode.NORMAL }) .height(30) ...
application-dev\ui\arkts-common-components-richeditor.md
controller: RichEditorController = new RichEditorController(); options: RichEditorOptions = { controller: this.controller } controller1: RichEditorController = new RichEditorController(); options1: RichEditorOptions = { controller: this.controller1 } // Create two RichEditor components. RichEditor(this.options) .onR...
application-dev\ui\arkts-common-components-switch.md
Toggle(options: { type: ToggleType, isOn?: boolean })
application-dev\ui\arkts-common-components-switch.md
Toggle({ type: ToggleType.Checkbox, isOn: false }) Toggle({ type: ToggleType.Checkbox, isOn: true })
application-dev\ui\arkts-common-components-switch.md
Toggle({ type: ToggleType.Switch, isOn: false }) Toggle({ type: ToggleType.Switch, isOn: true })
application-dev\ui\arkts-common-components-switch.md
Toggle({ type: ToggleType.Button, isOn: false }) { Text('status button') .fontColor('#182431') .fontSize(12) }.width(100) Toggle({ type: ToggleType.Button, isOn: true }) { Text('status button') .fontColor('#182431') .fontSize(12) }.width(100)
application-dev\ui\arkts-common-components-switch.md
Toggle({ type: ToggleType.Button, isOn: true }) { Text('status button') .fontColor('#182431') .fontSize(12) }.width(100).selectedColor(Color.Pink) Toggle({ type: ToggleType.Checkbox, isOn: true }) .selectedColor(Color.Pink) Toggle({ type: ToggleType.Switch, isOn: true }) .selectedColor(Color.P...
application-dev\ui\arkts-common-components-switch.md
Toggle({ type: ToggleType.Switch, isOn: false }) .switchPointColor(Color.Pink) Toggle({ type: ToggleType.Switch, isOn: true }) .switchPointColor(Color.Pink)
application-dev\ui\arkts-common-components-switch.md
Toggle({ type: ToggleType.Switch, isOn: false }) .onChange((isOn: boolean) => { if(isOn) { // Operation } })
application-dev\ui\arkts-common-components-switch.md
// xxx.ets import { promptAction } from '@kit.ArkUI'; @Entry @Component struct ToggleExample { @State BOnSt:promptAction.ShowToastOptions = {'message': 'Bluetooth is on.'} @State BOffSt:promptAction.ShowToastOptions = {'message': 'Bluetooth is off.'} build() { Column() { Row() { Text("Bluetooth ...
application-dev\ui\arkts-common-components-symbol.md
SymbolGlyph($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .renderingStrategy(SymbolRenderingStrategy.SINGLE) .fontColor([Color.Black, Color.Green, Color.White])
application-dev\ui\arkts-common-components-symbol.md
Text() { SymbolSpan($r('sys.symbol.ohos_trash')) .fontWeight(FontWeight.Normal) .fontSize(96) }
application-dev\ui\arkts-common-components-symbol.md
Row() { Column() { Text("48") Text() { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(48) .renderingStrategy(SymbolRenderingStrategy.SINGLE) .fontColor([Color.Black, Color.Green, Color.White]) } } Column() { Text("72") Text(...
application-dev\ui\arkts-common-components-symbol.md
Row() { Column() { Text("Light") Text() { SymbolSpan($r('sys.symbol.ohos_trash')) .fontWeight(FontWeight.Lighter) .fontSize(96) } } Column() { Text("Normal") Text() { SymbolSpan($r('sys.symbol.ohos_trash')) .fontWeight(FontWeight.N...
application-dev\ui\arkts-common-components-symbol.md
Row() { Column() { Text("Black") Text() { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .fontColor([Color.Black]) } } Column() { Text("Green") Text() { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) ....
application-dev\ui\arkts-common-components-symbol.md
Row() { Column() { Text("Single-color mode") Text() { SymbolSpan($r('sys.symbol.ohos_folder_badge_plus')) .fontSize(96) .renderingStrategy(SymbolRenderingStrategy.SINGLE) .fontColor([Color.Black, Color.Green, Color.White]) } } Column() { Text("M...
application-dev\ui\arkts-common-components-symbol.md
Row() { Column() { Text("No effect") Text() { SymbolSpan($r('sys.symbol.ohos_wifi')) .fontSize(96) .effectStrategy(SymbolEffectStrategy.NONE) } } Column() { Text("Overall scale effect") Text() { SymbolSpan($r('sys.symbol.ohos_wifi')) ...
application-dev\ui\arkts-common-components-symbol.md
@State isActive: boolean = true; Column() { Text("Variable Color Effect") SymbolGlyph($r('sys.symbol.ohos_wifi')) .fontSize(96) .symbolEffect(new HierarchicalSymbolEffect(EffectFillStyle.ITERATIVE), this.isActive) Button(this.isActive ? 'Off' : 'Play').onClick(() => { this.isActive = !th...
application-dev\ui\arkts-common-components-symbol.md
@State triggerValueReplace: number = 0; Column() { Text("Bounce Effect") SymbolGlyph($r('sys.symbol.ellipsis_message_1')) .fontSize(96) .fontColor([Color.Gray]) .symbolEffect(new BounceSymbolEffect(EffectScope.WHOLE, EffectDirection.UP), this.triggerValueReplace) Button('Trigger').onClic...
application-dev\ui\arkts-common-components-symbol.md
@State wifiColor: ResourceColor = Color.Black; SymbolGlyph($r('sys.symbol.ohos_wifi')) .fontSize(96) .fontColor([this.wifiColor]) .onClick(() => { this.wifiColor = Color.Gray; })
application-dev\ui\arkts-common-components-symbol.md
// xxx.ets @Entry @Component struct Index { @State triggerValueReplace: number = 0; @State symbolSources: Resource[] = [$r('sys.symbol.repeat'), $r('sys.symbol.repeat_1'), $r('sys.symbol.arrow_left_arrow_right')]; @State symbolSourcesIndex: number = 0; @State symbolText: string[] = ['Play in order', 'Loop s...
application-dev\ui\arkts-common-components-text-display.md
Text('I am a piece of text')
application-dev\ui\arkts-common-components-text-display.md
Text($r('app.string.module_desc')) .baselineOffset(0) .fontSize(30) .border({ width: 1 }) .padding(10) .width(300)
application-dev\ui\arkts-common-components-text-display.md
Text('I am Text') { Span('I am Span') } .padding(10) .borderWidth(1)
application-dev\ui\arkts-common-components-text-display.md
Text() { Span('I am Span1,').fontSize(16).fontColor(Color.Grey) .decoration({ type: TextDecorationType.LineThrough, color: Color.Red }) Span('I am Span2').fontColor(Color.Blue).fontSize(16) .fontStyle(FontStyle.Italic) .decoration({ type: TextDecorationType.Underline, color: Color.Black }) ...
application-dev\ui\arkts-common-components-text-display.md
Text() { Span('I am Upper-span').fontSize(12) .textCase(TextCase.UpperCase) } .borderWidth(1) .padding(10)
application-dev\ui\arkts-common-components-text-display.md
Text() { Span('I am Upper-span').fontSize(12) .textCase(TextCase.UpperCase) .onClick(() => { console.info('I am Span - onClick'); }) }
application-dev\ui\arkts-common-components-text-display.md
Text('Left aligned') .width(300) .textAlign(TextAlign.Start) .border({ width: 1 }) .padding(10) Text('Center aligned') .width(300) .textAlign(TextAlign.Center) .border({ width: 1 }) .padding(10) Text('Right aligned') .width(300) .textAlign(TextAlign.End) .border({ width: ...
application-dev\ui\arkts-common-components-text-display.md
Text('This is the setting of textOverflow to Clip text content. This is the setting of textOverflow to None text content. This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content.') .width(250) .textOverflow({ overflow: TextOverflow.None }) .maxLines(...
application-dev\ui\arkts-common-components-text-display.md
Text('This is the text with the line height set. This is the text with the line height set.') .width(300).fontSize(12).border({ width: 1 }).padding(10) Text('This is the text with the line height set. This is the text with the line height set.') .width(300).fontSize(12).border({ width: 1 }).padding(10) .l...
application-dev\ui\arkts-common-components-text-display.md
Text('This is the text') .decoration({ type: TextDecorationType.LineThrough, color: Color.Red }) .borderWidth(1).padding(10).margin(5) Text('This is the text') .decoration({ type: TextDecorationType.Overline, color: Color.Red }) .borderWidth(1).padding(10).margin(5) T...
application-dev\ui\arkts-common-components-text-display.md
Text('This is the text content with baselineOffset 0.') .baselineOffset(0) .fontSize(12) .border({ width: 1 }) .padding(10) .width('100%') .margin(5) Text('This is the text content with baselineOffset 30.') .baselineOffset(30) .fontSize(12) .border({ width: 1 }) .padding(10) ...
application-dev\ui\arkts-common-components-text-display.md
Text('This is the text content with letterSpacing 0.') .letterSpacing(0) .fontSize(12) .border({ width: 1 }) .padding(10) .width('100%') .margin(5) Text('This is the text content with letterSpacing 3.') .letterSpacing(3) .fontSize(12) .border({ width: 1 }) .padding(10) .wid...
application-dev\ui\arkts-common-components-text-display.md
Text('My maximum font size is 30, minimum font size is 5, width is 250, and maximum number of lines is 1') .width(250) .maxLines(1) .maxFontSize(30) .minFontSize(5) .border({ width: 1 }) .padding(10) .margin(5) Text('My maximum font size is 30, minimum font size is 5, width is 250, and max...
application-dev\ui\arkts-common-components-text-display.md
Text('This is the text content with textCase set to Normal.') .textCase(TextCase.Normal) .padding(10) .border({ width: 1 }) .padding(10) .margin(5) // The text is displayed in lowercase. Text('This is the text content with textCase set to LowerCase.') .textCase(TextCase.LowerCase) .bord...
application-dev\ui\arkts-common-components-text-display.md
Text("This text is copyable") .fontSize(30) .copyOption(CopyOptions.InApp)
application-dev\ui\arkts-common-components-text-display.md
Text('Click Me') .onClick(() => { console.info('I am the response to the click event'); })
application-dev\ui\arkts-common-components-text-display.md
// xxx.ets @Entry @Component struct TextExample { build() { Column() { Row() { Text("1").fontSize(14).fontColor(Color.Red).margin({ left: 10, right: 10 }) Text("I am entry 1") .fontSize(12) .fontColor(Color.Blue) .maxLines(1) .textOverflow({ overflow: ...
application-dev\ui\arkts-common-components-text-input.md
TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: TextInputController})
application-dev\ui\arkts-common-components-text-input.md
TextArea(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: TextAreaController})
application-dev\ui\arkts-common-components-text-input.md
TextInput()
application-dev\ui\arkts-common-components-text-input.md
TextArea()
application-dev\ui\arkts-common-components-text-input.md
TextArea({ text: "I am TextArea I am TextArea I am TextArea" }).width(300)
application-dev\ui\arkts-common-components-text-input.md
TextInput() .type(InputType.Normal)
application-dev\ui\arkts-common-components-text-input.md
TextInput() .type(InputType.Password)
application-dev\ui\arkts-common-components-text-input.md
TextInput({ placeholder: 'I am placeholder text' })
application-dev\ui\arkts-common-components-text-input.md
TextInput({ placeholder: 'I am placeholder text', text: 'I am current text input' })
application-dev\ui\arkts-common-components-text-input.md
TextInput({ placeholder: 'I am placeholder text', text: 'I am current text input' }) .backgroundColor(Color.Pink)
application-dev\ui\arkts-common-components-text-input.md
TextInput() .onChange((value: string) => { console.info(value); }) .onFocus(() => { console.info('Get Focus'); })
application-dev\ui\arkts-common-components-text-input.md
@Entry @Component struct TextInputSample { build() { Column() { TextInput({ placeholder: 'input your username' }).margin({ top: 20 }) .onSubmit((EnterKeyType) => { console.info(EnterKeyType + 'Enter key type'); }) TextInput({ placeholder: 'input your password' }).type(InputTy...
application-dev\ui\arkts-common-components-text-input.md
// xxx.ets @Entry @Component struct Index { placeHolderArr: string[] = ['1', '2', '3', '4', '5', '6', '7']; build() { Scroll() { Column() { ForEach(this.placeHolderArr, (placeholder: string) => { TextInput({ placeholder: 'TextInput ' + placeholder }) .margin(30) }) ...
application-dev\ui\arkts-common-components-text-input.md
// EntryAbility.ets import { KeyboardAvoidMode } from '@kit.ArkUI'; // Used in UIAbility onWindowStageCreate(windowStage: window.WindowStage) { // The main window is created. Set a main page for this ability. hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); windowStage.loadContent('pa...
application-dev\ui\arkts-common-components-text-input.md
// xxx.ets @Entry @Component struct Index { @State caretPosition: number = 600; areaController: TextAreaController = new TextAreaController(); text = "Most of us compare ourselves with anyone we think is happier — a relative, someone we know a lot, or someone we hardly know. As a result, what we do remember is an...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Component export struct VideoPlayer { private controller: VideoController = new VideoController() private previewUris: Resource = $r('app.media.preview') private innerResource: Resource = $rawfile('videoTest.mp4') build() { Column() { Video({ src: this.innerResou...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Component export struct VideoPlayer { private controller: VideoController = new VideoController() private previewUris: Resource = $r('app.media.preview') private videoSrc: string = 'dataability://device_id/com.domainname.dataability.videodata/video/10' build() { Column() { ...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Component export struct VideoPlayer { private controller: VideoController = new VideoController() private videoSrc: string = 'file:///data/storage/el2/base/haps/entry/files/show.mp4' build() { Column() { Video({ src: this.videoSrc, controller: this.controller }) } ...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Component export struct VideoPlayer { private controller: VideoController = new VideoController() private previewUris: Resource = $r('app.media.preview') private videoSrc: string = 'https://www.example.com/example.mp4' // Replace the URL with that of the actual video to load. build() { Column()...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Component export struct VideoPlayer { private controller: VideoController = new VideoController() build() { Column() { Video({ controller: this.controller }) .muted(false) // Set whether to mute the video. .controls(false) // Set whether to display the video play...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Entry @Component struct VideoPlayer { private controller: VideoController = new VideoController() private previewUris: Resource = $r('app.media.preview') private innerResource: Resource = $rawfile('videoTest.mp4') build() { Column() { Video({ src: this.innerResource, previ...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Entry @Component struct VideoGuide { @State videoSrc: Resource = $rawfile('videoTest.mp4') @State previewUri: string = 'common/videoIcon.png' @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X build() { Row() { Column() { Video({ src...
application-dev\ui\arkts-common-components-video-player.md
// xxx.ets @Entry @Component struct VideoGuide { @State videoSrc: Resource = $rawfile('videoTest.mp4') @State previewUri: string = 'common/videoIcon.png' @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X @State isAutoPlay: boolean = false @State showControls: boolean = true ...
application-dev\ui\arkts-common-events-crown-event.md
onDigitalCrown(event: (event?: CrownEvent) => void)
application-dev\ui\arkts-common-events-crown-event.md
Text(this.message) .fontSize(20) .fontColor(Color.White) .backgroundColor("#262626") .textAlign(TextAlign.Center) .focusable(true) .focusOnTouch(true) .defaultFocus(true)
application-dev\ui\arkts-common-events-crown-event.md
.onDigitalCrown((event: CrownEvent) => {})
application-dev\ui\arkts-common-events-crown-event.md
event.stopPropagation(); this.message = "CrownEvent\n\n" + JSON.stringify(event); console.debug("action:%d, angularVelocity:%f, degree:%f, timestamp:%f", event.action, event.angularVelocity, event.degree, event.timestamp);
application-dev\ui\arkts-common-events-crown-event.md
// xxx.ets @Entry @Component struct CityList { @State message: string = "onDigitalCrown"; build() { Column() { Row(){ Stack() { Text(this.message) .fontSize(20) .fontColor(Color.White) .backgroundColor("#262626") .textAlign(TextAlign.Cente...
application-dev\ui\arkts-common-events-device-input-event.md
onHover(event: (isHover: boolean) => void)
application-dev\ui\arkts-common-events-device-input-event.md
// xxx.ets @Entry @Component struct MouseExample { @State hoverText: string = 'Not Hover'; @State Color: Color = Color.Gray; build() { Column() { Button(this.hoverText) .width(200).height(100) .backgroundColor(this.Color) .onHover((isHover?: boolean) => { // Listen for whether t...
application-dev\ui\arkts-common-events-device-input-event.md
onMouse(event: (event?: MouseEvent) => void)
application-dev\ui\arkts-common-events-device-input-event.md
// xxx.ets @Entry @Component struct MouseExample { @State buttonText: string = ''; @State columnText: string = ''; @State hoverText: string = 'Not Hover'; @State Color: Color = Color.Gray; build() { Column() { Button(this.hoverText) .width(200) .height(100) .backgroundColor(...
application-dev\ui\arkts-common-events-device-input-event.md
class ish{ isHovered:boolean = false set(val:boolean){ this.isHovered = val; } } class butf{ buttonText:string = '' set(val:string){ this.buttonText = val } } @Entry @Component struct MouseExample { @State isHovered:ish = new ish() build(){ Column(){ Button(this.isHovered ? 'Hovered!' ...
application-dev\ui\arkts-common-events-device-input-event.md
event.stopPropagation()
application-dev\ui\arkts-common-events-device-input-event.md
hoverEffect(value: HoverEffect)
application-dev\ui\arkts-common-events-device-input-event.md
// xxx.ets @Entry @Component struct HoverExample { build() { Column({ space: 10 }) { Button('Auto') .width(170).height(70) Button('Scale') .width(170).height(70) .hoverEffect(HoverEffect.Scale) Button('Highlight') .width(170).height(70) .hoverEffect(HoverE...
application-dev\ui\arkts-common-events-device-input-event.md
onKeyEvent(event: (event: KeyEvent) => void): T onKeyEvent(event: Callback<KeyEvent, boolean>): T onKeyPreIme(event: Callback<KeyEvent, boolean>): T onKeyEventDispatch(event: Callback<KeyEvent, boolean>): T
application-dev\ui\arkts-common-events-device-input-event.md
// xxx.ets @Entry @Component struct KeyEventExample { @State buttonText: string = ''; @State buttonType: string = ''; @State columnText: string = ''; @State columnType: string = ''; build() { Column() { Button('onKeyEvent') .defaultFocus(true) .width(140).height(70) .onKeyEv...
application-dev\ui\arkts-common-events-device-input-event.md
@Entry @Component struct KeyEventExample { @State buttonText: string = ''; @State buttonType: string = ''; @State columnText: string = ''; @State columnType: string = ''; build() { Column() { Button('onKeyEvent') .defaultFocus(true) .width(140).height(70) .onKeyEvent((event?...