UITextView wraps text when built with iOS 7 SDK

后端 未结 4 715
北恋
北恋 2021-02-03 11:49

I have a UITextView inside a UIScrollView that worked perfectly fine on iOS 6 built from xcode 4.x, however now building with

4条回答
  •  無奈伤痛
    2021-02-03 12:10

    method sizeWithFont:(UIFont *)font constrainedToSize ..." has been deprecated in iOS 7.

    It would function properly.

    Check out its alternate in iOS 7

    Instance Method of NSString

    -(CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:
    
    (NSDictionary *)attributes context:(NSStringDrawingContext *)context
    

    Check this answer out. Replacement for deprecated sizeWithFont: in iOS 7?

提交回复
热议问题