开发者

CoreText flip coordinates self.bounds.size.height error bounds

开发者 https://www.devze.com 2023-03-31 03:10 出处:网络
I am drawing text in the view with CoreText. To learn this I used a tutorial, but suddenly it uses self.bounds.size.height, in a part wher开发者_运维百科e it flips the coordinate system. When I was du

I am drawing text in the view with CoreText. To learn this I used a tutorial, but suddenly it uses self.bounds.size.height, in a part wher开发者_运维百科e it flips the coordinate system. When I was duplicating the code in Xcode it gave an error because 'bounds' was not a structure or union. Why is this a error and can anyone give a small but detailed explanation of why it uses bounds Thanks on forehand, Nicholas


If you placed that code inside a UIViewController subclass, it should be: self.view.bounds.size.height. Or put it in a UIView subclass like in the tutorial you followed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号