Android的UiAutomatorViewer无法检测的一些看法 [英] Android UiAutomatorViewer can't detect some Views

查看:790
本文介绍了Android的UiAutomatorViewer无法检测的一些看法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题UIAutomatorViewer与我的应用程序。如果你看一下截图,突出显示的视图应该是一个孩子的TextView一个的FrameLayout,但你没有看到这一点。

I'm having problems with UIAutomatorViewer with my app. If you look at the screenshot, the highlighted View is supposed to be a FrameLayout with a child TextView, but you do not see that.

该活动有以下XML:

<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.blahblah.MainActivity">

    <!-- As the main content view, the view below consumes the entire
         space available using match_parent in both dimensions. -->
    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />



    <!-- android:layout_gravity="start" tells DrawerLayout to treat
         this as a sliding drawer on the left side for left-to-right
         languages and on the right side for right-to-left languages.
         If you're not building against API 17 or higher, use
         android:layout_gravity="left" instead. -->
    <!-- The drawer is given a fixed width in dp and extends the full height of
         the container. -->
    <fragment
        android:id="@+id/navigation_drawer"
        android:name="com.blahblah.NavigationDrawerFragment"
        android:layout_width="@dimen/navigation_drawer_width"
        android:layout_height="match_parent"
        android:layout_gravity="start" />

</android.support.v4.widget.DrawerLayout>

置于该的FrameLayout片段具有以下的xml:

The fragment placed in this FrameLayout has the following xml:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" tools:context="com.blahblah.BlankFragment">

    <!-- TODO: Update blank fragment layout -->
    <TextView android:layout_width="match_parent" android:layout_height="match_parent"
        android:text="@string/hello_blank_fragment" />

</FrameLayout>

有谁知道潜在原因呢?

Does anyone know potential causes for this?

推荐答案

也许ID丢失?尝试设置机器人:ID为您TextView元素

Maybe id is missing? Try to set android:id for your TextView element.

这篇关于Android的UiAutomatorViewer无法检测的一些看法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆