Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add left or top property of container is not work #319

Closed
scriptiot-dev opened this issue Sep 14, 2022 · 1 comment
Closed

add left or top property of container is not work #319

scriptiot-dev opened this issue Sep 14, 2022 · 1 comment

Comments

@scriptiot-dev
Copy link

from inspect import stack
import flet
from flet import Stack, Text, Container, Draggable, DragTarget, Page, Row, border, colors


def main(page: Page):
    page.title = "Container example"
    c = Container()
    c.bgcolor = "red"
    c.height = 150
    c.width = 200
    page.add(c)


flet.app(target=main)

image

add left or top property of container is not work

from inspect import stack
import flet
from flet import Stack, Text, Container, Draggable, DragTarget, Page, Row, border, colors


def main(page: Page):
    page.title = "Container example"

    c = Container()
    c.bgcolor = "red"
    c.height = 150
    c.width = 200
    c.left = 300 
    c.top = 300
    page.add(c)


flet.app(target=main)

image

@FeodorFitsner
Copy link
Contributor

left, top, right and bottom properties work only when control is inside of Stack control, e.g.

page.add(Stack([
  Text("Hello!", left=100, top=100)
], expand=True))

There is a related issue: #296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants