Busalaev Busalaev - 3 years ago 142
Objective-C Question

Incorrect work of scengraph xcode

I need help.
In any good editors i have simple mechanism to work with UI. But XCode it`s not good editor. My question is in the following:

I created UIView and set any constraints like here http://take.ms/g27uy

But if i run this to iphone6s simulator, then all children's shift right like here http://take.ms/JH2er

WHY???? All controls(button + text) lie on this view. Why is this happing?

Answer Source

Hope below solution will help you

Step 1

Create view like TabBar and give it proper Constraints. as image describe below with L,T,B & H Constraints.

enter image description here

Step 2

Add One subview to that view and give it all Constraints to superview with equal width and height. Now suppose you are having 3 tabs then the added subview height should be 1/3. so you just need to give height Constraints's multiplier to 1/3 as below image

enter image description here

and your Main view (Custom Tabbar view) should look like this

enter image description here

Step 3

Add Second view for second tab item with same width and height Constraints as first tab item. image for it as below

enter image description here

Make sure the first and second tab items no need of trailing Constraints the last item contains it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download