NSParagraphStyle line spacing ignored

后端 未结 6 1220
梦如初夏
梦如初夏 2020-12-23 17:48

A simple test that is failed: Make a new project with just one subview (UITextView) and put the following in:

- (void)viewDidLoad
{
    [super viewDidLoad];         


        
6条回答
  •  离开以前
    2020-12-23 18:13

    As nacho4d answered, in iOS 6 you need to use minimumLineHeight and maximumLineHeight and set font directly in UITextView, not in NSAttributedString as line height in that case will be overridden.

    Please note that when you set font in UITextView, the "editable" property of UITextView should be set to YES, in other case attributed text would not be affected.

    These issues are present only in iOS 6. In iOS 7 and above everything is ok;

提交回复
热议问题