Closed haianhsing closed 4 years ago
While I add a wrap_content view in ConstraintLayout and set app:layout_constraintBottom_toBottomOf="parent", only adding android:layout_marginBottom="appropriate values", it can see at screen. Maybe onLayout function has some problem.
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:gravity="center" android:text="text" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent" android:layout_width="0dp" android:layout_height="wrap_content"/> </androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:gravity="center" android:text="text" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent" android:layout_width="0dp" android:layout_marginBottom="48dp" android:layout_height="wrap_content"/> </androidx.constraintlayout.widget.ConstraintLayout>
The view without margin also normal display
set android:layout_height="value" or do not use ConstraintLayout
Hornor20, sansumg s9
After testing, CL 2.0 beta 3 has been fixed
Describe the bug
While I add a wrap_content view in ConstraintLayout and set app:layout_constraintBottom_toBottomOf="parent", only adding android:layout_marginBottom="appropriate values", it can see at screen. Maybe onLayout function has some problem.
To Reproduce
Expected behavior
The view without margin also normal display
Known workaround
set android:layout_height="value" or do not use ConstraintLayout
Environment:
Hornor20, sansumg s9