是否可以在蓝图模式下使用ConstraintLayout滚动ScrollView? [英] Is it possible to scroll a ScrollView with a ConstraintLayout in Blueprint Mode?

本文介绍了是否可以在蓝图模式下使用ConstraintLayout滚动ScrollView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我一直在使用ScrollView中的ConstraintLayout开发此布局.它工作正常,但现在我遇到了问题.我必须将布局扩展到屏幕之外.我可以在设计"模式下滚动,但是如果不将其卡在顶部,则无法添加任何内容.约束是针对较早的对象的,而不是我要添加的当前对象.

So I have been developing this layout using a ConstraintLayout inside a ScrollView. It works fine, but now I have hit a problem. I have to expand the layout outside the screen. I can scroll in Design mode, but I cannot add anything without it getting stuck to the top. The constraints are for earlier objects, not the current one I'm adding.

我可以在蓝图"模式下添加约束,但是看起来我无法在蓝图"模式下滚动ScrollView.这有可能吗?使用Android Studio 2.2(发行版)和constraint-layout:1.0.0-alpha8

I can add constraints in Blueprint mode, but it looks like I cannot scroll the ScrollView in blueprint mode. Is this even possible? Using Android Studio 2.2(release) and constraint-layout:1.0.0-alpha8

我尝试像在设计"模式下那样进行操作,但是它不会滚动.有什么想法吗?

I tried doing it like in Design mode, but it doesn't scroll. Any ideas?

使用ConstraintLayout正常滚动会使约束保持在同一位置.

Scrolling normally with ConstraintLayout causes the constraints to stay in the same location.

已更新为alpha9,但仍无法解决

Updated to alpha9 but still does not solve it

beta1也不起作用. AS 2.2.2.

beta1 does not work either. AS 2.2.2.

示例布局:

<Button
    android:text="Button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/sampleButton"
 />

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:ignore="HardcodedText">

    <android.support.constraint.ConstraintLayout

        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <!-- ETC constraints -->
    </android.support.constraint.ConstraintLayout>
</ScrollView>

推荐答案

滚动约束将滚动约束.这意味着可以在蓝图模式下滚动ConstraintLayout,并且可以按预期运行.它适用于Android Studio 2.3.2及更高版本(我没有较旧的版本).

As of ConstraintLayout 1.0.1 scrolling scrolls the constraints. Meaning it is possible to scroll a ConstraintLayout in blueprint mode and it functions as expected. It works at Android Studio 2.3.2 and up (I haven't older versions).

现在,滚动时,可见视图,边框和约束都随绘制的按钮一起移动.

Now when scrolling, both the visible view, the border, and constraints move along with the drawn button.

这篇关于是否可以在蓝图模式下使用ConstraintLayout滚动ScrollView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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