UITextView Height

Hi,


I created a UITextView which I set a height of 50.

When testing it is not shown on my view.

If I add a constraint with height = 50, this works, but xcode states there is a conflicting constraint with another being height=0

This constraint is nowhere to be found.


If I view the conflicting constraints, they are both shown, but I can only select and view the detail of the height = 50 constraint...


Am I missing something here?


Regards

Accepted Reply

Images do not show on the forum !!!


In the size Inspector, what is "Intrinsic size" ? (at the very bottom): that could explain the height = 0, as a computed value. Change the value of this attribute, just to check.

Try to add some text in the UITextView (Attributes Inspector): does the UITextView shows at run time ?


Finally, you may try to change the vertical compression to higher value (800 vs 750)

Replies

What is the content mode for the UITextView (see in Attributes Inspector) ?

You could also set a background color for the view (in Attributes Inspector) to see if the UITextView appears.


Could you post the exact copy of the error message ?


Can you also describe all the constraints involving this UITextView (see size inspector to get all constraints)

Hi Claude,


>> What is the content mode for the UITextView (see in Attributes Inspector) ?

The settings of the text view are left default, "Content Mode" is "Scale to fill".

It's meant to be used as a few line editable remarks field.


>> You could also set a background color for the view (in Attributes Inspector) to see if the UITextView appears.

Just set it to red, which I can clearly see on IB, but not when test running


>> Could you post the exact copy of the error message ?

Clicking the yellow warning triangle top left of IB (goes to issue navigator @ buildtime)

Unsupported Configuration

=> 1 conflicting constraints

Main.storyboard

=> height = 50


Clicking the red circle in the document view:

- Conflicting Constraints

* Height = 50 (clickable, goes to constraint)

* Height = 0 (not selectable)


>> Can you also describe all the constraints involving this UITextView (see size inspector to get all constraints)

3 constraints:

- Trailing space to superview

- Leading space to superview

- height equals: 50


Thanks for trying to help. This is all new for me. I am a programmer for a job, but all on windows / .net / ...

So actually my first mac and first tryout on iOS. I followed the sample "FoodTracker" on developer.apple.com, but there was no text view there.


Regards


EDIT: seems like my pasted images are not shown...

Images do not show on the forum !!!


In the size Inspector, what is "Intrinsic size" ? (at the very bottom): that could explain the height = 0, as a computed value. Change the value of this attribute, just to check.

Try to add some text in the UITextView (Attributes Inspector): does the UITextView shows at run time ?


Finally, you may try to change the vertical compression to higher value (800 vs 750)

>seems like my pasted images are not shown..


About that. SeeFor Best Results - Read the Label

Thanks, it was indeed the intrinsic size. It was set to "Default (system defined)"

by setting it to placeholder but leaving the new settings default, there was no longer a double constraint