ios - UITableView Height does not fit container vertically (bottom) for different iPhone devices -


I have a UITableView that is in one view. I am testing the app on iPhone 4S and it is very good doing work. Now I tried to test it on iPhone 5S (which has a long screen). UITableView is not suitable for the bottom I know that it has to do with auto layout, but I'm not sure how to set it up.

There are two approaches in my mind:

1-) Programmaticly set the height for the screen and then setting the UITableView height to the screen to fit the program 2 -) Using auto-layout in the interface builder. But I get the warning that autolayout works only for iOS 8 and higher. So how do I apply it to the lower versions of iOS?

So my question is: How to set the speed of a UITWV so that it fits in the lower part of the screen whether it is the iPhone screen?

Thanks for any help.

You can set different table views for different screen sizes in this way. It defines in the header of the .m file

  #define IS_IPHONE_5 (Fibs ((double) [[UIScreen main screen] limit] .size.height - (double) 568) Lt; DBL_EPSILON)  

This defines the viewDidLoad () method

  if (ISIHHUU5) {self.tableView = [[UITableView alloc] initWithFrame : CGRectMake (0,0, 320, 568)]; } Else {// 3.5 for screen defined self.tableView = [[UITableView alloc] initWithFrame: CGRectMake (0,0, 320, 480)]; }  

I hope this should help.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -