'Set 5 textViews in HorizontalLayout to fill it programmatically
I have 5 TextViews created programmatically inside of HorizontalLayout Can't manage them to fill Layout each with 20% of space. Usually it can be made by setting width to "MATCH_PARENT", in my case it somehow just adding bunch of space Screenshots: How's that looks without setting width And if I set width "Name" on screenshots is a part of another layout
Code where I set width
val texts = listOf(mealWeightText, mealProteinText, mealFatText, mealCarbonText, mealCaloriesText)
for (t in texts){
t.layoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT)}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
