TextView.text is cut mid width inside TableLayout TableRow

27 views Asked by At

Main issue: text is squished so hard by View, so it gets cut. Key moments:

  1. TableRow is a child of LinearLayout so weight is supported.
  2. TableRow contains one TextView with android:layout_width="wrap_content" other are "0dp"
  3. All TableRow child views have android:weight="1"
  4. TableLayout android:isScrollContainer="true" is present

Text cut issue photo image

full code here: https://gist.github.com/Sukhobrusov/af5608c520056e114743215eca1631f0

  1. android:isScrollContainer="true"
  2. TextView.android:layout_gravity="fill"
  3. Placing everything inside HorizontalScrollView won't work, as width is not working "0dp"
  4. view hierarchy:
Table
- Row
- - Text wrap_content
- - Text 0dp
- - Text 0dp
.
.
~

Expected behaviour: View is squished to the limit until it's impossible to surpass the minWidth = 1 symbol. WRAP_CONTENT TextView shouldn't push more as the limit is reached.

1

There are 1 answers

1
Alex Sukhobrusov On

Well. It's impossible to stretch the TableLayout from XML the way I wanted to. So the answer will be to just set the android:layout_width to some number and REMOVE THE WEIGHTS

Table
- Row
- - Text wrap_content
- - Text 10dp
- - Text 10dp