美文网首页
UIView的frame相关的几个方法

UIView的frame相关的几个方法

作者: lele8446 | 来源:发表于2016-10-26 10:10 被阅读23次

一段渐进式改变frame的代码

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.25];
[UIView setAnimationDelegate:self];
self.view.frame = CGRectMake(0, 0, 320, 200);
[UIView commitAnimations];

坐标转换

CGRect frame = [self.view convertRect:self.lastCell.frame fromView:self.tableView];
CGRect frame = [self.tableView convertRect:self.lastCell.frame toView:self.view];

缩放大小

self.view.transform = CGAffineTransformMakeScale(0.80, 0.80);

在 LLDB 使用 po [[UIWindow keyWindow] recursiveDescription] 来检查层次结构。它可以以文本形式打印出完整的视图层次结构。

用 po [[[UIWindow keyWindow] rootViewController] _printHierarchy] 来检查视图控制器。

相关文章

网友评论

      本文标题:UIView的frame相关的几个方法

      本文链接:https://www.haomeiwen.com/subject/nyeduttx.html