Search code examples
androidandroid-constraintlayoutandroid-wrap-content

Android ConstraintLayout wrap_content does not show all the contents


I need to show all data in TextView, it must occupy all the available space horizontally and contain all the data vertically(it is necessary for different screen sizes or device orientation).

But it does not take the necessary vertical area:

screen here

Is it a bug or have a way to solve my problem? While I just use LinearLayout, there is no such problem.

My XML:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
    tools:context="com.example.u_m0uk4.fortest.MainActivity">

    <TextView
        android:id="@+id/textView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:layout_marginLeft="132dp"
        android:layout_marginRight="16dp"
        android:layout_marginStart="132dp"
        android:layout_marginTop="16dp"
        android:text="Android («Андро́ид»[ком. 1]) — операционная система для смартфонов, интернет-планшетов, электронных книг, цифровых проигрывателей, наручных часов, игровых приставок, нетбуков, смартбуков, очков Google[2], телевизоров[3] и других устройств. В будущем планируется поддержка автомобилей[4] и бытовых роботов. оследствии Google инициировала создание альянса Open Handset Alliance (OHA), который сейчас занимается поддержкой и дальнейшим развитием платформы. Android позволяет создавать Java-приложения, управляющие устройством через разработанные Google библиотеки. Android Native Development Kit позволяет портировать библиотеки и компоненты приложений, написанные на Си и других языках.12345678912345678901234567890-1234567890"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:layout_marginBottom="16dp" />

</android.support.constraint.ConstraintLayout>

Solution

  • Fixed in 9 version. Now it works as i need.