constraintlayout icon indicating copy to clipboard operation
constraintlayout copied to clipboard

Overlapping TextViews when optimizations are on

Open vanniktech opened this issue 3 years ago • 2 comments

Left image is with optimizations turned on, clearly showing an overlap between the two TextViews. Right image is rendering everything correctly:

overlapping

Here's a reproducible sample PR using constraint layout 2.1.0: https://github.com/vanniktech/playground/pull/1

My use case:

I have an RSS Reader where I'm loading images and depending whether the image is portrait or landscape I want to either

  • display the description underneath the title (when image is portrait)
  • display the description underneath the image + title (horizontally on the same line); (when image is landscape)

In my PR, I've quickly summed up this functionality.

For now my workaround is to:

constraintLayout.optimizationLevel = 0

vanniktech avatar Sep 19 '21 09:09 vanniktech

@jafu888 is there any further information you need?

vanniktech avatar Oct 02 '21 10:10 vanniktech

Also an issue with Constraint Layout 2.1.1 - potentially making it even worse:

Screenshot 2021-10-09 at 20 33 15

vanniktech avatar Oct 09 '21 18:10 vanniktech