tview
tview copied to clipboard
flex-start in tview
Is there a way to accomplish the equivalent of CSS Flexbox flex-start in tview?
I have a single line of text followed by a QR code which spans many lines. I want the QR code to appear right below the text line, but they are both taking up half the available height of the flex container.
CSS flex-start is a keyword used in multiple contexts so I'm not sure which one you're referring to. I would even argue that justify-content: flex-start is the default in tview's Flex component.
If you have a TextView with one line of text and another TextView with a QR code, do this:
flex.AddItem(oneLiner, 1, 0, true).
AddItem(qrCode, 0, 1, false)
This will place the QR code right underneath your one-line text.