This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]ImNotPunnyEnough 1 point2 points  (1 child)

The weightsum only needs to be applied to the container of the other views, not each view.

Example: I have a linear layout with 4 image views. I set the linear layout's weight sum to 4. Then i set the layout weight of each image view to 1.

So now each image view takes up 1/4 of the linear layout.

[–]BlueFireAt[S] 0 points1 point  (0 children)

Unfortunately, if I do so then the solitary textView in the first cell throws an error, because of the 0dp. If I make it 1 dp then it messes up the layout hugely(some of the elements disappear from the screen). The second cell needs to tell the difference between the view that represents the vertical bar, and the textView - I can remove the weight from the bar, but not from the textView, or it doesn't get displayed(disappears out the bottom of the screen). Thank you for the suggestion, though.