相关疑难解决方法(0)

Android - 如何制作可滚动的constraintlayout?

我想制作一个允许我使用约束布局向下滚动的布局,但我不知道如何去做.如果scrollview是这样的constraintlayout的父级吗?

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

<android.support.constraint.ConstraintLayout
    android:id="@+id/Constraint"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
Run Code Online (Sandbox Code Playgroud)

或者相反?也许有人可以指点我这方面的好教程或举个例子,我似乎无法找到一个.

此外,我不知道这是否是一个错误或一些配置,我不已经建立,但我看到了这样的图片 一个地方有蓝图"蓝色矩形"以外的一些成分但他们是可见的,而在我的身边,如果我将一个组件放在"白色空间"上我无法看到它或将其移动到任何地方,它出现在组件树上.

UPDATE

我找到了一种方法,可以在设计工具中滚动约束布局,使用horiontal准线向下推约束布局边框并将其扩展到设备之外,之后您可以使用引导线作为约束布局的新底部锚定组件.

android android-layout android-scrollview android-constraintlayout

120
推荐指数
8
解决办法
10万
查看次数

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

所以我一直在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>
Run Code Online (Sandbox Code Playgroud)

android android-layout android-scrollview android-studio-2.2 android-constraintlayout

12
推荐指数
1
解决办法
7301
查看次数