当前位置:网站首页>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)
边栏推荐
- 凌云出海记 | 文华在线&华为云:打造非洲智慧教学新方案
- Pointnet / pointnet++ point cloud data set processing and training
- In operation (i.e. included in) usage of SSRs filter
- #夏日挑战赛#带你玩转HarmonyOS多端钢琴演奏
- 什么叫内卷?
- Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
- 九齐NY8B062D MCU规格书/datasheet
- 多表操作-内连接查询
- 漫谈客户端存储技术之Cookie篇
- 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,
猜你喜欢
Pointnext: review pointnet through improved model training and scaling strategies++
Abc229 summary (connected component count of the longest continuous character graph in the interval)
九齐NY8B062D MCU规格书/datasheet
Creation of JVM family objects
记一次 .NET 某工控数据采集平台 线程数 爆高分析
ICML 2022 | Meta提出鲁棒的多目标贝叶斯优化方法,有效应对输入噪声
Actual combat simulation │ JWT login authentication
Small hair cat Internet of things platform construction and application model
What is involution?
Dynamic memory management
随机推荐
【ISMB2022教程】图表示学习的精准医疗,哈佛大学Marinka Zitnik主讲,附87页ppt
软件客户端数字签名一定要申请代码签名证书吗?
2022 Health Exhibition, Beijing Health Expo, China Health Exhibition, great health exhibition November 13
【深度学习】一文看尽Pytorch之十九种损失函数
实战模拟│JWT 登录认证
PHP pseudo original API docking method
C语言-入门-基础-语法-流程控制(七)
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
NLP、视觉、芯片...AI重点方向发展几何?青源会展望报告发布[附下载]
[Beijing Xunwei] i.mx6ull development board porting Debian file system
Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
What ppt writing skills does the classic "pyramid principle" teach us?
C language - Introduction - Foundation - grammar - process control (VII)
Actual combat simulation │ JWT login authentication
被奉为经典的「金字塔原理」,教给我们哪些PPT写作技巧?
1500万员工轻松管理,云原生数据库GaussDB让HR办公更高效
Abc229 summary (connected component count of the longest continuous character graph in the interval)
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Development and construction of DFI ecological NFT mobile mining system
数据集划分