当前位置:网站首页>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)
边栏推荐
- Dark horse programmer - software testing - 09 stage 2-linux and database -31-43 instructions issued by modifying the file permission letter, - find the link to modify the file, find the file command,
- [QNX hypervisor 2.2 user manual]6.3.1 factory page and control page
- Huawei cloud store homepage banner resource bit application
- c# . Net MVC uses Baidu ueditor rich text box to upload files (pictures, videos, etc.)
- Cbcgpprogressdlg progress bar used by BCG
- Multi table operation inner join query
- Kotlin condition control
- #夏日挑战赛#带你玩转HarmonyOS多端钢琴演奏
- In the first month of its launch, the tourist praise rate of this campsite was as high as 99.9%! How did he do it?
- node强缓存和协商缓存实战示例
猜你喜欢
如何让你的小游戏适配不同尺寸的手机屏幕
Employment prospects of neural network Internet of things application technology [welcome to add]
Selected review | machine learning technology for Cataract Classification / classification
TCP waves twice, have you seen it? What about four handshakes?
Application practice | Shuhai supply chain construction of data center based on Apache Doris
Cbcgpprogressdlg progress bar used by BCG
Multi table operation - external connection query
Introduction to ACM combination counting
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
太方便了,钉钉上就可完成代码发布审批啦!
随机推荐
九齐单片机NY8B062D单按键控制4种LED状态
ICML 2022 | meta proposes a robust multi-objective Bayesian optimization method to effectively deal with input noise
On communication bus arbitration mechanism and network flow control from the perspective of real-time application
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
应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设
【ISMB2022教程】图表示学习的精准医疗,哈佛大学Marinka Zitnik主讲,附87页ppt
New wizard effect used by BCG
c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)
Is it safe for Great Wall Securities to open an account? Stock account opening process online account opening
Actual combat simulation │ JWT login authentication
What financial products can you buy with a deposit of 100000 yuan?
How is the entered query SQL statement executed?
Related concepts of federal learning and motivation (1)
九齐NY8B062D MCU规格书/datasheet
被奉为经典的「金字塔原理」,教给我们哪些PPT写作技巧?
同事的接口文档我每次看着就头大,毛病多多。。。
Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
记一次 .NET 某工控数据采集平台 线程数 爆高分析
Huawei Nova 10 series supports the application security detection function to build a strong mobile security firewall
PHP pseudo original API docking method