flet.Column is not aligning its child controls #1093
-
| QuestionWhen returning a  Code sample# row.py
from flet import Row, Text, UserControl, MainAxisAlignment
class RowControl(UserControl):
    def __init__(self):
        super().__init__()
    def build(self):
        return Row(
            controls=[Text(value="Hello World!")],
            alignment=MainAxisAlignment.CENTER
        )
# column.py
from flet import Column, UserControl, MainAxisAlignment
from row import RowControl
class ColumnControl(UserControl):
    def __init__(self):
        super().__init__()
    def build(self):
        return Column(
            controls=[RowControl(), RowControl()],
            alignment=MainAxisAlignment.SPACE_BETWEEN,
        )
# main.py
import flet
from column import ColumnControl
def main(page: flet.Page):
    page.add(ColumnControl())
if __name__ == "__main__":
    flet.app(target=main)Error messageNo response ------------------------------------------------------
 | 
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
| I just fiddled around a bit and it seems to me that using Column or Row directly doesn't change the behaviour. With Row, you can change the horizontal alignment, but vertical_alignment doesn't really do anything in basic examples. With Column, neither alignment visibly changes anything in those examples. Strange that I never noticed this before.. | 
Beta Was this translation helpful? Give feedback.
-
| Read this discussion thread for answer. | 
Beta Was this translation helpful? Give feedback.

Read this discussion thread for answer.