xcode11做一个可以改变image view的按钮怎么做

qq_35432556 2020-01-13 09:00:15
看了个xcode10的做,感觉和xcode11不一样
...全文
340 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
江边鸟_ 2020-01-20
  • 打赏
  • 举报
回复
居然在纠结Xcode10 和 11~
诸葛非常的亮 2020-01-14
  • 打赏
  • 举报
回复
var statusPrinter: UIButton?
statusPrinter = UIButton(frame: CGRect(x: 340, y: Int(statusBarHeight), width: myStatusBarHeight, height: myStatusBarHeight))
statusPrinter!.setImage(UIImage(named: "PrinterOFF"), for: .normal)
self.view.addSubview(statusPrinter!)
statusPrinter?.addTarget(self, action: #selector(jumpToBlueTooth), for: .touchUpInside)
「已注销」 2020-01-13
  • 打赏
  • 举报
回复
如果是按钮上的图片改变的话。 你自定义个类,继承uibutton。 类里加个属性,UIimageview。 然后用你的按钮把这个图片添加进去。 button addsubview imageview 然后你设置这个imageview就好了
「已注销」 2020-01-13
  • 打赏
  • 举报
回复
问题描述的不太清楚。

29,049

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧