macos 右键菜单自定义_swiftui macos使用自定义颜色创建图像按钮

macos 右键菜单自定义

If you’re a genius like me, you need many days of scouring the web and weeping in the night to learn new things like… Swift and SwiftUI.

如果您是像我这样的天才,则需要花费很多时间在网上搜寻和夜间哭泣,才能学习诸如Swift和SwiftUI之类的新事物。

In this little tutorial, we’ll learn to:

在这个小教程中,我们将学习:

  1. Create a nice little “image button” that calls a function you’ve passed to it.

    创建一个漂亮的小“图像按钮”,以调用传递给它的函数。
  2. And shows the image in 32 x 32 no matter what the size of the image was.

    并以32 x 32的分辨率显示图像,无论图像大小如何。
  3. And is dynamically colored with your own custom color.

    并使用您自己的自定义颜色动态着色。

The end result is shown below. You click the button, and whatever function you passed to the view gets called. The blue you see is a custom blue.<

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值