最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[整理]swift中UIEdgeInsetsInsetRect的效果:可以缩放矩形frame

Swift crifan 6310浏览 0评论
可以通过:
UIEdgeInsetsInsetRect
去调整一个frame的尺寸
代码:
let originRect = CGRectMake(0, 0, 200, 400)
let demoView = UIView(frame: originRect)
let shrinkedRect = UIEdgeInsetsInsetRect(originRect, UIEdgeInsetsMake(0, 30, 0, 100))
let expandedRect = UIEdgeInsetsInsetRect(originRect, UIEdgeInsetsMake(0, 0, 0, -300))
 效果:
use UIEdgeInsetsInsetRect shrink and expand frame

转载请注明:在路上 » [整理]swift中UIEdgeInsetsInsetRect的效果:可以缩放矩形frame

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 0.169 seconds, using 22.05MB memory