鸿蒙OS开发文档 鸿蒙OS Text.TextColorObserver

2024-02-25 开发教程 鸿蒙OS开发文档 匿名 2

Text.TextColorObserver

public static interface Text.TextColorObserver

提供一个观察者来监听组件中的文本颜色变化。

每次文本颜色发生变化时都会调用 (int,int) 方法。

方法总结

修饰符和类型方法描述
voidonTextColorChanged(int before, int after)当文本颜色改变时调用。

方法详情

onTextColorChanged

void onTextColorChanged(int before, int after)

当文本颜色改变时调用。

参数:

参数名称参数描述
before指示以前的文本颜色。
after指示当前文本颜色。