1、通过下面的指令找到最上层的窗口id:
hdc shell "hidumper -s WindowManagerService -a '-a'"
输出内容的最后有
Highlighted windows: xxx
这里的xxx即是最上层的窗口id
2、查看最上层窗口的UI树获焦情况,结果导出到focusTree.log:
hdc shell "hidumper -s WindowManagerService -a '-w xxx -focus'" >> focusTree.log
xxx是第一步中的window id
输出的结果大致如下:
|-> ListItem(Scope*) id:2698 childSize:1
|-> Column(Scope*) id:2745 childSize:1
|-> Column(Scope*) id:2749 childSize:2
|-> Row(Scope) id:2750 childSize:2
|-> (-)Radio(Node) id:2751 Focusable:false childSize:0
|-> (-)Text(Node) id:2752 Focusable:false childSize:0
输出的UI树中,组件名称前带(-)的即为不可获焦的组件
组件名称后为(Scope*)的为可获焦的组件
鸿蒙系统UI树焦点分析指令
1328

被折叠的 条评论
为什么被折叠?



