Abhi
Abhi

Reputation: 95

How to remove blank space between two UITableView?

I have two UITableView. I have set first UITableView height = 600 and second UITableView height = 400. Second UITableView is below first UITableView. Both UITableView data comes from the database. The problem is, if data in the first UITableView is less than its height, then it shows blank space between first and second UITableView. I want both UITableView to have height according to its data and also want to remove that blank space.

This is how my UITableView looks

Upvotes: 0

Views: 105

Answers (1)

Super_Simon
Super_Simon

Reputation: 1296

That's because you haven't set the constraints up correctly and the UITableView is only doing what you asked it to do - set the height at 600.

To achieve the results you are looking for, you need to click the top UITableView and then click the size inspector button on the top right hand side (the little ruler) and change the "Height Equals" property constant.

If you change the constant to < 600 then it will be no greater than 600. If you change it to > 600 then it will only ever be no less than 600.

Upvotes: 1

Related Questions