0

On the iPhone X in the simulator, my container view is appearing below the tab bar (it is on the bottom of the screen).

I would like to move the container view so it is sitting on top of the tab bar, but no matter what I put in as the x and y of the container view frame, it won't change. I can only change the height.

Thanks.

Code:

//for custom interactive keyboard
override var inputAccessoryView: UIView? {
    get {
        return inputContainerView
    }
}    

lazy var inputContainerView: UIView = {

    let containerView = UIView()
    containerView.frame = CGRect(x: 50, y: 50, width: self.view.frame.width, height: 50)
    containerView.backgroundColor = UIColor.red

    return containerView
}()
connorvo
  • 761
  • 2
  • 7
  • 21

1 Answers1

0

Please mention which version of simulator you are using. There is significant improvement in storyboard rendering of iPHONE X in xcode 9.1.

Some points to be make sure for perfect UI in iPHONE X:

  1. Enable safe area layout guide.

  2. Remove height constraints of tab-bar, if any.

  3. Remove all constraints which, refer to superview and replace them with "Safe Area".

  4. Clean and run.

"There is still some bugs in iPHONE-X simulator rendering of tabbar which is added to viewcontroller, however tabbarcontroller is working fine. In my case, changing value of bottom bar in simulated matrix section of viewcontroller has solved problem."

Nikunj Joshi
  • 556
  • 5
  • 10
  • Where do you enable safe area layout guide? None of the other suggestions apply – connorvo Nov 08 '17 at 16:03
  • I found a workaround. I actually needed the containerView to cover the tab bar, so I just made it larger on iPhone 10 and changed a couple constraints of the things inside the view. – connorvo Nov 08 '17 at 16:20