是否可以在Blueprint模式下使用ConstraintLayout滚动ScrollView?

时间:2016-09-25 17:02:01

标签: android android-layout android-scrollview android-studio-2.2 android-constraintlayout

所以我一直在ScrollView中使用ConstraintLayout开发这个布局。它工作正常,但现在我遇到了问题。我必须在屏幕外扩展布局。我可以在设计模式下滚动,但如果没有它被卡在顶部,我就无法添加任何内容。约束是针对早期的对象,而不是我正在添加的当前对象。

我可以在Blueprint模式下添加约束,但看起来我无法在蓝图模式下滚动ScrollView。这甚至可能吗?使用Android Studio 2.2(发布)和constraint-layout:1.0.0-alpha8

我尝试在设计模式下执行此操作,但它不会滚动。有什么想法吗?

使用ConstraintLayout正常滚动会导致约束停留在同一位置。

修改

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

编辑2:

beta1也不起作用。 AS 2.2.2。

编辑3:

示例布局:

<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>

6 个答案:

答案 0 :(得分:3)

在android studio 2.2更新中,它默认包括滚动设计和蓝图模式。单击预览窗格中的设计模式,然后尝试滚动屏幕​​,它将开始滚动。在该模式中还有另一种蓝图选项,它向您显示设计的蓝图,并且通过这样做也可以帮助您滚动蓝图模式。

enter image description here enter image description here

答案 1 :(得分:2)

将Scroll视图放在Constraint布局之外。然后使用此[红色标记]拖动视图,它将为您创建自定义设备编辑器。完成后,请更改回设备编辑器[旁边旋转图标] ...

答案 2 :(得分:1)

还没有。

也许尝试使用单独的文件来编辑内容,并在您拥有ScrollView的文件中使用include?

答案 3 :(得分:1)

在最新的带有constraint-layout:1.0.0-beta1的android studio 2.2.2版本中,您可以滚动蓝图enter image description here

为了更好的工作,在更新constraint-layout之后,请重新启动android studio(使缓存无效)

答案 4 :(得分:1)

从ConstraintLayout 1.0.1开始,滚动滚动约束。这意味着可以在蓝图模式下滚动ConstraintLayout,它可以按预期运行。它适用于Android Studio 2.3.2及更高版本(我没有旧版本)。

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

答案 5 :(得分:0)

beta1版本has been released。我怀疑这是固定的,但检查出来。

您可以在此处要求提供错误修正:http://tools.android.com/feedback

PS:你正试图用鼠标滚轮滚动,对吗?嘿嘿只是检查...我说,因为就在最近我发现我可以使用鼠标滚轮在设计模式中滚动..嗯哈哈。我从未尝试过蓝图模式。

相关问题