Mou某
Mou某

Reputation: 596

Universal App: Getting Table View To Fill Whole Screen

I have two table views, both without table view controllers, I have a view controller that's taking care of both of them.

The problem is that I'm getting weird scalings of the tables on different devices. It seems to be almost perfect on the iPhone 4 simulator. The table looks almost ridiculous on any iPad simulator.

My Table Views View settings look like this:

settings

scale to fill

I tried changing the launch images to see if that would have any impact on scaling/zooming/etc, but that didn't really seem to change anything.

edit:

alignment constraints are disabled:

constraints

Upvotes: 0

Views: 447

Answers (2)

swapnali patil
swapnali patil

Reputation: 304

If you are using the autolayout give constaints to table view as leading, trailing, top & bottom. It will change its size as per device.

Upvotes: 1

Mahmoud Adam
Mahmoud Adam

Reputation: 5852

You need to set the frame of the table view to occupy the whole screen

UITableView tableView = [[UITableView alloc]  initWithFrame:self.view.bounds];

Upvotes: 0

Related Questions