0

So as a little background, I have a ViewController where I display a header label, and a another label for a review, with a lot of text.

I have tried to put a label inside a ScrollView, but as the review copy is different lengths for different products, it's just not simple to make the ScrollView height fit. I was also having a lot of issues making the label appear correctly inside the ScrollView - using constraints just didn't seem to make a difference. After some research, I noticed a lot of people said, just use a UITextView, and set it to not editable. So this is what I did. And it seemed to work. The scrollable textView always fitted the length of my text review. Perfect.

However, the text in the UITextView never appears as how I style it in main.storyboard. In the image below, you can see how the main review text is displaying (small and the colour black). The title on the screen, is how the review text has been styled in main.storyboard.

enter image description here

Why doesn't the review text appear how I styled it and how can I make it the way I want? I'm assuming this is a UITextView issue?

I haven't provided any code here, as I have styled everything in the main.storyboard. But this is how it looks in my main.Storyboard...

enter image description here

I have conformed to UITextViewDelegate and set the delegate to self in ViewDidLoad() - but from what I understand, this is only needed for the editable text, of which I have disabled.

Thanks in advanced, and ask if you need anymore info from me!

CODE RELATING TO THE TEXTVIEW USED ON THE VC:

@IBOutlet weak var filmReviewText: UITextView!

// Mark:- Colour for textView text
var textColour: UIColor = UIColor.whiteColor()

and in the ViewDidLoad() I put,

filmReviewText.editable = false
filmReviewText.textColor = textColour
Nick89
  • 2,948
  • 10
  • 31
  • 50
  • Could you show a screenshot of the styling done in storyboard? – hannad Dec 17 '15 at 11:01
  • @hannad I can provide it this evening, but it's styled exactly the same as the header you see (Jurassic World in 3D) the same size, font and colour. – Nick89 Dec 17 '15 at 11:04
  • I am not sure why this happens. Did you try setting the style programmatically? – hannad Dec 17 '15 at 11:06
  • @hannad I did try changing the colour programmatically, but it made no difference, so I just deleted that bit of code. – Nick89 Dec 17 '15 at 11:11
  • @hannad I have added in the screenshot from my main.storyboard – Nick89 Dec 17 '15 at 18:57
  • I am honestly not sure what is going on. Is there anywhere in your code that may possibly give this styling to the `UITextView`? – hannad Dec 17 '15 at 19:03
  • @hannad I've added in the question above, the only code i've used relating to the textView – Nick89 Dec 17 '15 at 19:09
  • If you remove `filmReviewText.editable = false`. Does it stay the same? – hannad Dec 17 '15 at 19:10
  • @hannad Just tried it, no difference – Nick89 Dec 17 '15 at 19:12
  • I'm afraid I don't know, but this is the last thing that might help. I found this [question](http://stackoverflow.com/questions/19113673/uitextview-setting-font-not-working-with-ios-6-on-xcode-5) earlier which said that setting `editable` to `false` in the storyboard gave him a problem. – hannad Dec 17 '15 at 19:15
  • @hannad That link had my answer! Selecting the option in main.storyboard called 'Selectable' fixed everything. If you wanted to add this as an answer here I will select it for you. (you found the answer!) – Nick89 Dec 17 '15 at 19:22

0 Answers0