0
votes

I have a UIViewController with two UITableView like this

enter image description here

when the interface rotate I would like this interface

enter image description here

but with Autolayout I can't be able to achieve this.

Here the constraints for table view A:

  • Leading space
  • Bottom space
  • Top space
  • Align center Y

and for table view B

  • Trailing space
  • Bottom space
  • Top space
  • Align center Y

and here the result:

enter image description here

If I add the constraint horizontal space between table view to 0 here is the result

enter image description here

How can I solve it without setting programmatically the frame? I wanna using Autolayout.

Solution based on @sha answer

Constraints for table view A:

  • Leading space
  • Bottom space
  • Top space
  • Width equals to B
  • Horizontal space from B = 0

and for table view B

  • Trailing space
  • Bottom space
  • Top space
  • Width equals to A
  • Horizontal space from A = 0
1
@ParvendraSingh : frame don't work in autolayout... - Fahim Parkar

1 Answers

4
votes

Remove align Y constraint (you don't need it if they take all available height) and add one to make width the same for A and B.