当前位置:网站首页>Flet教程之 05 OutlinedButton基础入门(教程含源码)
Flet教程之 05 OutlinedButton基础入门(教程含源码)
2022-07-04 18:49:00 【知识大胖】
什么是OutlinedButton
轮廓按钮是中等强调按钮。它们包含重要的操作,但不是应用程序中的主要操作。轮廓按钮与填充按钮很好地配对,以指示替代的次要操作。
实战代码

import flet
from flet import OutlinedButton, Page
def main(page: Page):
page.title = "Basic outlined buttons"
page.add(
OutlinedButton(text="Outlined button"),
OutlinedButton("Disabled button", disabled=True),
)
flet.app(target=main)
带图的button

import flet
from flet import OutlinedButton, Page
def main(page: Page):
page.title = "Outlined buttons with icons"
page.add(
OutlinedButton("Button with icon", icon="chair_outlined"),
OutlinedButton(
"Button with colorful icon",
icon="park_rounded",
icon_color="green400",
),
)
flet.app(target=main)
响应点击

import flet
from flet import OutlinedButton, Page, Text
def main(page: Page):
page.title = "Outlined button with 'click' event"
def button_clicked(e):
b.data += 1
t.value = f"Button clicked {b.data} time(s)"
page.update()
b = OutlinedButton("Button with 'click' event", on_click=button_clicked, data=0)
t = Text()
page.add(b, t)
flet.app(target=main)
自定义按钮

import flet
from flet import (
Column,
Container,
Icon,
OutlinedButton,
Page,
Row,
Text,
icons,
padding,
)
def main(page: Page):
page.title = "Outlined buttons with custom content"
page.add(
OutlinedButton(
width=150,
content=Row(
[
Icon(name=icons.FAVORITE, color="pink"),
Icon(name=icons.AUDIOTRACK, color="green"),
Icon(name=icons.BEACH_ACCESS, color="blue"),
],
alignment="spaceAround",
),
),
OutlinedButton(
content=Container(
content=Column(
[
Text(value="Compound button", size=20),
Text(value="This is secondary text"),
],
alignment="center",
spacing=5,
),
padding=padding.all(10),
),
),
)
flet.app(target=main)
边栏推荐
- 更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
- Anhui Zhong'an online culture and tourism channel launched a series of financial media products of "follow the small editor to visit Anhui"
- So this is the BGP agreement
- Prometheus installation
- 六石编程学:关于代码,有六个得意
- C language - Introduction - Foundation - grammar - process control (VII)
- Wireshark network packet capture
- 1009 product of polynomials (25 points) (PAT class a)
- 原来这才是 BGP 协议
- Template_ Judging prime_ Square root / six prime method
猜你喜欢

What does the neural network Internet of things mean? Popular explanation
![[ismb2022 tutorial] the picture shows the precision medicine of learning. Marinka zitnik, Harvard University, keynote speaker, with 87 ppt](/img/0d/aa7f82fada743ea2ec23355ef954df.jpg)
[ismb2022 tutorial] the picture shows the precision medicine of learning. Marinka zitnik, Harvard University, keynote speaker, with 87 ppt

Actual combat simulation │ JWT login authentication

Ziguang zhanrui completed the first 5g R17 IOT NTN satellite on the Internet of things in the world

c# . Net MVC uses Baidu ueditor rich text box to upload files (pictures, videos, etc.)

针对深度学习的“失忆症”,科学家提出基于相似性加权交错学习,登上PNAS

Pytoch learning (4)

九齐NY8B062D MCU规格书/datasheet

Form组件常用校验规则-1(持续更新中~)

Write it down once Net analysis of thread burst height of an industrial control data acquisition platform
随机推荐
What does the neural network Internet of things mean? Popular explanation
Lingyun going to sea | Wenhua online & Huawei cloud: creating a new solution for smart teaching in Africa
【深度学习】一文看尽Pytorch之十九种损失函数
repeat_ P1002 [NOIP2002 popularization group] cross the river pawn_ dp
Abc229 summary (connected component count of the longest continuous character graph in the interval)
Related concepts of federal learning and motivation (1)
Informatics Olympiad 1336: [example 3-1] find roots and children
Anhui Zhong'an online culture and tourism channel launched a series of financial media products of "follow the small editor to visit Anhui"
九齐NY8B062D MCU规格书/datasheet
Data set division
数据集划分
Why is the maximum speed the speed of light
YOLOv5s-ShuffleNetV2
一文搞懂Go语言中文件的读写与创建
上线首月,这家露营地游客好评率高达99.9%!他是怎么做到的?
AP8022开关电源小家电ACDC芯片离线式开关电源IC
Dark horse programmer - software testing - stage 08 2-linux and database-23-30-process port related, modify file permissions, obtain port number information, program and process related operations, Li
QT writing the Internet of things management platform 38- multiple database support
为什么最大速度是光速
华为nova 10系列支持应用安全检测功能 筑牢手机安全防火墙