相关疑难解决方法(0)

iOS AutoLayout - 获取帧大小宽度

我正在使用iOS 6自动布局进行开发

我想记录一条显示视图框宽的消息.

我可以在屏幕上看到textView.

但我得到的宽度和高度为零,我错过了什么?

NSLog(@"textView    = %p", self.textView);
NSLog(@"height      = %f", self.textView.frame.size.height);
NSLog(@"width       = %f", self.textView.frame.size.width);

textView    = 0x882de00
height      = 0.000000
width       = 0.000000
Run Code Online (Sandbox Code Playgroud)

nslog ios autolayout

58
推荐指数
7
解决办法
6万
查看次数

标签 统计

autolayout ×1

ios ×1

nslog ×1