1

I am using auto layout for a month and this is a pain in my head. By some reasons if I set text to my textview that has constraints, App shows me not the same color and font as I set in storyboard, but seems default.

I am not sure if this simulator issue maybe?

I set text programmatically in -viewDidLoad

If I not set text in viewDidLoad:

enter image description here

If I set text in viewDidLoad:

enter image description here

12
  • Add screen shots if possible. Commented Dec 22, 2014 at 13:40
  • @Kampai, as you can see if I don't set text in code. The textview has white text, but if I set my textView.text = @"some text"; it cause font issue and color. Like seems use default settings. Commented Dec 22, 2014 at 13:48
  • 1
    Is it possible that you set attributed text string in storyboard. Commented Dec 22, 2014 at 14:02
  • @gabbler, no the text is plain. and there are no any code that change text color or font. Commented Dec 22, 2014 at 14:06
  • @gabbler alos I have two setups in storyboard for all iphones and for all ipads. So for iPad I have set for textview alignment center for text, but seems it inherit some properties from iphone, because for iPhone I use justify text and the same I can see for iPad right now. Commented Dec 22, 2014 at 14:08

1 Answer 1

7

I found the issue if I uncheck Selectable checkbox in storyboard for UITextView then it causes this issue if I set text form the code. When I mark it checked again then it resolves my issue.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.