HOW TO CHANGE THE HEIGHT OF TABLE VIEW IN IOS?

Jennifer Morgan

Total Post:13

Points:95
Posted by  Jennifer Morgan
 571  View(s)
Ratings:
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..?

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: How to change the height of table view in iOS?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!