Home > DeveloperSection > Forums > How to change the height of table view in iOS?
Jennifer Morgan
Jennifer Morgan

Total Post:13

Posted on    March-28-2016 12:31 AM

 iPhone iPhone  Ios  Objective C  Ipad 

 1 Reply(s)
 285  View(s)
Rate this:
I am a beginner in iOS application development. I am getting problem when I set the frame of table view, it is not working.
I use this code to set the frame:
[self.tableView setFrame:CGRectMake(0, 0, 240, 360)];

but it does't change the table view frame.
Please any one tell me how can I set the frame of table view..?

Tarun Kumar

Total Post:210

Posted on    April-05-2016 2:05 AM

If you have getting issue after setting the tableview frame then you can also use the method viewDidLayoutSubviews:.
Use your table view frame set code in the viewDidLayoutSubviews: method.
Below I have provided an example:

- (void) viewDidLayoutSubviews
    [self.tableView setFrame:CGRectMake(20, 10, 200, 300)];

I hope it will resolve your table view frame set issue.

Don't want to miss updates? Please click the below button!

Follow MindStick