如果嵌套在scrollview中,约束布局会测量不正确的高度 [英] Constraint Layout measures incorrect height if it is nested into scrollview

查看:181
本文介绍了如果嵌套在scrollview中,约束布局会测量不正确的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<android.support.v4.widget.NestedScrollView 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="wrap_content"
    android:fillViewport="true">

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

///Content

    </android.support.constraint.ConstraintLayout>

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

在这种情况下,约束布局要长.我的子视图的marginEnd也有问题.我有很多类似的子观点

In this case constraint layout to long. I also have problem with marginEnd of child views. I have a lot of child views similar to

 <TextView
            android:id="@+id/tvDurationPlan"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/margin_medium"
            android:textSize="@dimen/txt_size_small"
            style="@style/WhiteTextViewStyle"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintLeft_toLeftOf="@+id/tvPlanLabel"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/tvPlanLabel"
            app:layout_constraintVertical_bias="0.0"
            android:layout_marginEnd="16dp"
            tools:text="TextView" />

和layout_marginEnd不起作用. 请帮帮我!

and layout_marginEnd doesn't work. Please help me!

推荐答案

,此错误已在com.android.support.constraint:constraint-layout:1.1.0-beta3

as I could say, this bug was fixed in com.android.support.constraint:constraint-layout:1.1.0-beta3

这篇关于如果嵌套在scrollview中,约束布局会测量不正确的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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