UITextView - setting font not working with iOS 6 on XCode 5

后端 未结 12 1752
旧时难觅i
旧时难觅i 2020-11-27 16:14

I\'m using storyboards for my UI. I was previously using XCode 4.6 and released on iOS 6. I have since updated to iOS 7 using XCode 5 and updated the Storyboard to work nice

12条回答
  •  隐瞒了意图╮
    2020-11-27 16:39

    In my case(Developing on Xcode 7.3, iOS 9),

    The cause was the order of setting text and font-family/size, not the options of editable or selectable many answers tell there.(and I don't get any storyboard, xib on that Textview.)

    If I input like

    [myTextView setFont:[UIFont fontWithName:@"HelveticaNeue-Italic" size:20]];
    myTextView.attributedText = mAttStr;
    

    then the font's family and size are not changed, but else when I reverse those two step, it works. Setting text should be ahead of setting font's family/size.

提交回复
热议问题