0

1a. I had issues with conflicts being reported so I set a Key Path named translatesAutoresizingMaskIntoConstraints in User Defined Runtime Attributes to false (or 'unchecked' checkbox).
1b. Redundancy with (1a): I have self.view.translatesAutoresizingMaskIntoConstraints = false; in the viewDidLoad method.
2. I checked what the storyboard looks like with different devices and they all present the textView in the correct position. See image.
3. Scientific method: without changing anything else in the project, adding constraints causes the issue. Removing them allows for a visible textView, however, it obviously no longer resizes to fit the other devices.
4. I have attempted using constraints both with Safe Area and without.

enter image description here

If I simply added constraints for the top, bottom, left side, and right side (all 0) shouldn't the view at least be stretched out and visible?

Update View Debug Image

The purple (purple means thread-related?) warning says Position and size are ambiguous for UIView. enter image description here

Update 2, UITextView smaller than UIView

The following happens when Safe Area is used and when it isn't used. Notice the white strip across the top and bottom which are part of the UIView, but not part of the UITextView. enter image description here

Update 3

I made some progress. I removed the top and bottom bar from most views, but the bottom bar still shows up in the 'output' view controller that I've been focusing on, however, the top one is gone! I had to uncheck 'Extend Edges Under Top Bars' and 'Extend Edges Under Bottom Bars'

Timothy Swan
  • 623
  • 3
  • 9
  • 21
  • correct, adding constraints to top, bottom, leading, and trailing to the superview should be fine. You can use the technique of adding a temporary backgroundColor to your `UITextView` to see where such view goes in your screen. You can also use the Xcode's view debugger to check in run time the position and state of your `UITextView`, then give your question an update after these steps :) – Glenn Posadas Oct 09 '17 at 16:16
  • See my update. The furthest thing down the list to show up as highlighted is the `UIViewControllerWrapperView`. The `OutputViewController` isn't highlighted as you can see in the image. Note the purple warning as well. – Timothy Swan Oct 09 '17 at 16:38

1 Answers1

0

Your problem is quite simple so I'm posting an answer rather to continue commenting. Don't do this self.view.translatesAutoresizingMaskIntoConstraints = false;

You only set a specific view's translatesAutoresizingMaskIntoConstraints to false when you're doing constraints programmatically. Since you're making your layout in Storyboard, you do not have to do that especially in your superView (self.view).

About your constraints problem, you can clear all your constraints first and then re-add the constraints.

Clearing constraints

enter image description here

Adding constraints to top, bottom, leading, and trailing. Uncheck constrain to margins

enter image description here

Now you should be able to see your UITextView, compare your constraints to mine.

Glenn Posadas
  • 12,555
  • 6
  • 54
  • 95
  • See **Update 2** in my question for another image. I matched my constraints to be like yours and also tried it without Safe Area. I also commented out `self.automaticallyAdjustsScrollViewInsets = false;` which used fix an issue that I had with spacing the text on the TextView. It still ends up with white horizontal bars. – Timothy Swan Oct 09 '17 at 18:29
  • Hi Timothy, what are the two `UIImageView`s under your `UITextView`? Also, what do you exactly want to achieve? Are you sure that you're adding the constraints 0 top, 0 bottom, 0 leading, and 0 trailing properly? – Glenn Posadas Oct 09 '17 at 18:51
  • Those must have been generated at runtime. I don't want those horizontal white lines to appear. I'm going to delete my navigation controller and create a new one. The one I made is about 3 years old and it might be propagating strange navigation bar behavior down the views. – Timothy Swan Oct 10 '17 at 00:42
  • I've been messing with settings and I was able to get rid of the top bar, but the bottom bar is still there. See **Update 3** – Timothy Swan Oct 10 '17 at 01:22
  • Alright, so I randomly fixed the bottom after messing with settings. I'm not sure what to do about giving an answer to this stackoverflow question, though. – Timothy Swan Oct 11 '17 at 01:33
  • There are many options for that :) 1. Select this answer as the answer. 2. Post your answer if you think it will help people in the future. 3. Delete your question. – Glenn Posadas Oct 11 '17 at 02:34