未验证 提交 2a55de5d 编写于 作者: O openharmony_ci 提交者: Gitee

!11703 无障碍辅助功能扩展上下文模块的示例代码修改

Merge pull request !11703 from zaki/master
......@@ -244,6 +244,7 @@ getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback\<Accessib
```ts
let focusElement;
let isAccessibilityFocus = true;
try {
axContext.getFocusElement(isAccessibilityFocus, (err, data) => {
if (err) {
......@@ -368,6 +369,7 @@ getWindowRootElement(windowId: number, callback: AsyncCallback\<AccessibilityEle
```ts
let rootElement;
let windowId = 10;
try {
axContext.getWindowRootElement(windowId, (err, data) => {
if (err) {
......@@ -698,7 +700,7 @@ let rootElement;
try {
rootElement.attributeValue(attributeName).then((data) => {
console.log('get attribute value by name success');
attribtueValue = data;
attributeValue = data;
}).catch((err) => {
console.log('failed to get attribute value, because ' + JSON.stringify(err));
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册