mirror of
https://github.com/rivo/tview.git
synced 2026-04-29 14:55:54 +03:00
[GH-ISSUE #272] TextView: Vertical Alignment #210
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#210
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @amery on GitHub (Apr 19, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/272
Hi, could you provide an example about how to center vertically the text of a TextView?
@diamondburned commented on GitHub (Apr 22, 2019):
I tried implementing a Primitive for that here: https://gitlab.com/diamondburned/spotuify/blob/master/views/loading/loading.go#L34
Do note that this is not a TextView, which means it does not support markup formatting.
@amery commented on GitHub (Apr 22, 2019):
thanks, I'll study it :)
@rivo commented on GitHub (May 14, 2019):
There is no automatic vertical alignment in a
TextView. This would lead to navigation issues so I don't think such a flag would become part of this primitive.But if you know in advance how many lines your
TextViewwill have, you can center it by putting it in the middle of a three-rowFlexwhere only the top and bottom rows have flexible heights.If the number of lines is unknown and may even be larger than the available height, I cannot think of a solution with
TextViewat the moment.@caiguanhao commented on GitHub (Jan 3, 2022):
or: