UIButton设置image上下左右位置 swift
iOS15:比较简单了(苹果为啥到了iOS15才想起来按钮还需要这个功能呢)。Button新增UIButton.Configuration用来配置
if #available(iOS 15.0, *) { var config = UIButton.Configuration.plain() ///这里imagePlacement图片的位置 .leading .trailing .bottom .top config.imagePlacement = .top config.imagePadding = 10 config.image = UIImage(named: "imgname") testButton.configuration = config }
在北京的灯中,有一盏是我家的。这个梦何时可以实现?哪怕微微亮。北京就像魔鬼训练营,有能力的留,没能力的走……
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步