最新消息:VPS服务器又从fzhost.net换回Linode了,主题仍用朋友推荐的大前端D8

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

Swift crifan 1921浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
16 queries in 0.185 seconds, using 9.80MB memory