I’m trying to use a Flex Repeater in a header. The flex repeater should be the left-most item in the FlexView and other items in the header should be aligned next to it. This is why I chose the “row” direction for the FlexView
The 1st subview should apperar in top-left, then 2nd subview below and so-on. The items should wrap to a 2nd column if the header is too short. This is why I chose the “column” direction on the FlexRepeater. This is working well.
Now for the challenge:
The Flex Repeater in the horizontal (row) direction should only use the space it requires to show all of the subviews and not grow beyond that.
As shown above, grow set to “1” on the Flex Container and the Blank Space label gives about half the available horizontal space to each component since they are of equal weight.
Keeping grow=1 on the Label and setting grow=0 on the FlexRepeater also doesn’t work.
Below is the JSON for my view if anyone can point me to the properties I need to change:
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 145,
"width": 402
}
},
"root": {
"children": [
{
"meta": {
"name": "ListOfButtons"
},
"position": {
"grow": 1
},
"props": {
"alignContent": "flex-start",
"alignItems": "flex-start",
"direction": "column",
"elementPosition": {
"basis": "auto",
"grow": 0,
"shrink": 0
},
"instances": [
{
"Name": 1
},
{
"Name": 2
},
{
"Name": 3
}
],
"path": "subview",
"style": {
"borderStyle": "solid"
},
"useDefaultViewHeight": false,
"useDefaultViewWidth": false,
"wrap": "wrap"
},
"type": "ia.display.flex-repeater"
},
{
"meta": {
"name": "Label"
},
"position": {
"grow": 1
},
"props": {
"text": "Blank Space"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
}