Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Constraint Layout measures incorrect height if it is nested into 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>

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

and layout_marginEnd doesn't work. Please help me!

like image 278
Ihor Kucherenko Avatar asked Apr 19 '17 16:04

Ihor Kucherenko


People also ask

What is bias in Constraint layout android?

Bias, in terms of ConstraintLayout , means "if there is extra room, slide the widget in this direction along the axis". The default bias is 0.5, meaning that the widget is centered in the available space.

What is androidx ConstraintLayout widget ConstraintLayout?

GitHub - androidx/constraintlayout: ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way. Skip to content Toggle navigation. Product.

What is the Constraint layout?

A ConstraintLayout is a ViewGroup which allows you to position and size widgets in a flexible way. Note: ConstraintLayout is available as a support library that you can use on Android systems starting with API level 9 (Gingerbread). As such, we are planning on enriching its API and capabilities over time.


1 Answers

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

like image 152
Sough Avatar answered Oct 19 '22 15:10

Sough