http://liuxing8807.blog.163.com/blog/static/9703530520134381526554/ sizeThatFits and sizeToFit是UIView的两个方法, 官方文档上说: - (CGSize)sizeThatFits:(CGSize)size; 作用:return 'best' size to fit given size. does not actually resize view. Default is return existin…
知识锦集day01 1.UIView的两个方法: sizeThatFits和 sizeToFit 官方文档上说: - (CGSize)sizeThatFits:(CGSize)size; //----->返回一个最接近你填的参数的最适合的Size, 不是真的去重新调整View的size,默认使用原先已存在的Size作用:return 'best' size to fit given size. does not actually resize view. Default is retu…
原文链接 sizeToFit()和sizeThatFits(_:) sizeToFit()会调用sizeThatFits(_:)方法,将现在的frame作为参数.然后根据函数返回的结果更新view. sizeToFit will simply call through to sizeThatFits: passing the view's current size as the argument. It will then update the view's frame based on the…