|
11精币
@LEOONL 大神帮忙看看实在是解决不了啦。。。
node 取文本中间感觉会把最前面取到,怎么取对应的?
<node NAF="true" index="1" text="ABC" resource-id="com.huang.autorunmarket:id/goRightView" class="android.widget.ImageView" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[426,1034][472,1080]" /> </node> <node index="3" text="" resource-id="com.huang.autorunmarket:id/mainAppLay1" class="android.widget.LinearLayout" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,1100][720,1280]"> <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,1100][240,1260]"> <node NAF="true" index="0" text="" resource-id="com.huang.autorunmarket:id/mainAppIcon1" class="android.widget.ImageView" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[65,1100][175,1210]" /> <node index="1" text="浏览器" resource-id="com.huang.autorunmarket:id/mainAppText1" class="android.widget.TextView" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,1210][240,1260]" /> </node> <node index="1" text="" resource-id="com.huang.autorunmarket:id/mainAppLay2" class="android.widget.LinearLayout" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[240,1100][480,1260]"> <node NAF="true" index="0" text="" resource-id="com.huang.autorunmarket:id/mainAppIcon2" class="android.widget.ImageView" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[305,1100][415,1210]" /> <node index="1" text="设置" resource-id="com.huang.autorunmarket:id/mainAppText2" class="android.widget.TextView" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[240,1210][480,1260]" /> </node> <node index="2" text="" resource-id="com.huang.autorunmarket:id/mainAppLay4" class="android.widget.LinearLayout" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[480,1100][720,1260]"> <node NAF="true" index="0" text="" resource-id="com.huang.autorunmarket:id/mainAppIcon4" class="android.widget.ImageView" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[545,1100][655,1210]" /> <node index="1" text="文件管理" resource-id="com.huang.autorunmarket:id/mainAppText4" class="android.widget.TextView" package="com.huang.autorunmarket" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[480,1210][720,1260]" /> </node> </node> </node> </node> </node>
resource-id="com.huang.autorunmarket:id/mainAppIcon4" resource-id="com.huang.autorunmarket:id/goRightView" resource-id="com.huang.autorunmarket:id/mainAppText2"resource-id="com.huang.autorunmarket:id/mainAppText1"
我需要这4个能获取到 text里面的文本
返回= 文本_取中间 (Xml文本, “<node index=”, “resource-id="com.huang.autorunmarket:id/mainAppText4", str, , , , , , )
-----取到 text里面的文本
返回(文件管理)
返回(设置)
返回(浏览器)
返回(ABC)
|
最佳答案
查看完整内容
这是取了几个上面你返回的
补充内容 (2024-11-8 02:43):
这种的话你要用取正则才方便
|