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

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

阅读 540
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)
    }
  }
}