当前位置:网站首页>Basic introduction to the 16 tabs tab control in the fleet tutorial (the tutorial includes source code)

Basic introduction to the 16 tabs tab control in the fleet tutorial (the tutorial includes source code)

2022-07-07 11:55:00 Knowledge fatness

Flet What is it?

Flet It's a framework , Make it easy for you to build real-time in your favorite language Web、 Mobile and desktop applications , And share them safely with your team . No front-end experience .

What is? GridView

Tab controls are used to navigate different content categories that are frequently accessed . Tabs allow you to navigate between two or more content views , And rely on text titles to express different parts of the content .

Combat code

tabs-simple.gif

import flet
from flet import Image, Page, GridView, border_radius

def main(page: Page):
    page.title = "GridView Example"
    page.theme_mode = "dark"
    page.padding = 50
    page.update()

    images = GridView(
        expand=1,
        runs_count=5,
        max_extent=150,
        child_aspect_ratio=1.0,
        spacing=5,
        run_spacing=5,
    )

    page.add(images)

    for i in range(0, 60):
        images.controls.append(
            Image(
                src=f"https://picsum.photos/150/150?{i}",
                fit="none",
                repeat="noRepeat",
                border_radius=border_radius.all(10),
            )
        )
    page.update()

flet.app(target=main, view=flet.WEB_BROWSER)

原网站

版权声明
本文为[Knowledge fatness]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070945547012.html

随机推荐