当前位置:网站首页>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)
边栏推荐
- CANN算子:利用迭代器高效实现Tensor数据切割分块处理
- MySQL中的日期时间类型与格式化方式
- Multi table operation - external connection query
- FS4061A升压8.4V充电IC芯片和FS4061B升压12.6V充电IC芯片规格书datasheet
- Lingyun going to sea | 10 jump &huawei cloud: jointly help Africa's inclusive financial services
- Why is the maximum speed the speed of light
- How to adapt your games to different sizes of mobile screen
- What ppt writing skills does the classic "pyramid principle" teach us?
- [Beijing Xunwei] i.mx6ull development board porting Debian file system
- On communication bus arbitration mechanism and network flow control from the perspective of real-time application
猜你喜欢
Multi table operation inner join query
Pointnext: review pointnet through improved model training and scaling strategies++
FS8B711S14电动红酒开瓶器单片机IC方案开发专用集成IC
In operation (i.e. included in) usage of SSRs filter
Niuke Xiaobai month race 7 who is the divine Archer
Employment prospects of neural network Internet of things application technology [welcome to add]
B2B mall system development of electronic components: an example of enabling enterprises to build standardized purchase, sale and inventory processes
太方便了,钉钉上就可完成代码发布审批啦!
C # better operation mongodb database
实战模拟│JWT 登录认证
随机推荐
@Data source connection pool exhaustion caused by transactional abuse
数据集划分
Neural network IOT platform construction (IOT platform construction practical tutorial)
ICML 2022 | Meta提出鲁棒的多目标贝叶斯优化方法,有效应对输入噪声
HMM hidden Markov model and code implementation
上线首月,这家露营地游客好评率高达99.9%!他是怎么做到的?
【历史上的今天】7 月 4 日:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生
Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
记一次 .NET 某工控数据采集平台 线程数 爆高分析
Wireshark network packet capture
复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
水晶光电:长安深蓝SL03的AR-HUD产品由公司供应
C server log module
FS8B711S14电动红酒开瓶器单片机IC方案开发专用集成IC
[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born
NLP、视觉、芯片...AI重点方向发展几何?青源会展望报告发布[附下载]
Huawei Nova 10 series supports the application security detection function to build a strong mobile security firewall
Niuke Xiaobai month race 7 F question
多表操作-内连接查询
Is it safe for Great Wall Securities to open an account? Stock account opening process online account opening