HarmonyOS TextInput 不可编辑时不可更改文本颜色?

如题:HarmonyOS TextInput 不可编辑时不可更改文本颜色?

阅读 538
1 个回答

参考demo:

@Entry
@Component
struct Index {
  @State message: string = 'Hello World';

  build() {
    Column() {
      TextInput({ text: this.message }).focusOnTouch(false).fontColor(Color.Red)
      TextInput({ text: this.message }).focusOnTouch(true).fontColor(Color.Red)
    }
  }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进