简体   繁体   English

如何在图形布局编辑器中选择FrameLayout的视图?

[英]How can I select a FrameLayout's views in the Graphical Layout Editor?

I have a FrameLayout containing two RelativeLayouts . 我有一个包含两个RelativeLayoutsFrameLayout When I try to use the Graphical Layout tab in ADT, only the two ImageViews in the second RelativeLayout are selectable. 当我尝试在ADT中使用“图形布局”选项卡时,只能选择第二个RelativeLayout中的两个ImageView。 The layout looks like this: 布局如下所示:

<FrameLayout>
    <RelativeLayout>

        <ScrollView>
            <TextView/>
        </ScrollView>

        <ImageView/>

        <ScrollView>
            <TextView/>
        </ScrollView>
    </RelativeLayout>

    <RelativeLayout>
        <ImageView/>

        <ImageView/>
    </RelativeLayout>
</FrameLayout>

Wherever else I click, it selects the entire second RelativeLayout itself, and cannot click on any individual views within the first RelativeLayout . 无论我单击何处,它都会选择整个第二个RelativeLayout本身,并且无法单击第一个RelativeLayout内的任何单个视图。

Is there a way to cycle through the views/layouts so I can edit what I see on screen? 有没有一种方法可以循环浏览视图/布局,以便我可以编辑在屏幕上看到的内容? Or is this a bug/limitation of the editor? 还是这是编辑器的错误/局限性?

One very clunky way to do this is to: 一种很笨拙的方法是:

  1. Switch to the text editor tab. 切换到文本编辑器选项卡。

  2. Move the cursor within the view XML that you would like to edit. 在要编辑的视图XML内移动光标。

  3. Switch back to the graphical editor and the element is selected. 切换回图形编辑器,然后选择元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM