table view in popover is not scrolling

前端 未结 2 1804
青春惊慌失措
青春惊慌失措 2021-02-06 15:24

I have the code below to display popover with tableview and it works perfectly.

The tableview displays 13 numbers and I can scroll and see the same but when I relea

2条回答
  •  清歌不尽
    2021-02-06 16:07

    Try set the ContentSize of the tableView, like this:

    [tblViewMenu setContentSize:CGSizeMake(320,680)];
    

    Also, I'd prefere to make the size of the tableView dynamic. depend on your tableView Datasource array.

    UPDATE

    To make the tableView dynamic, use this:

    [tblViewMenu setContentSize:CGSizeMake(320, ([numbers count] * 32))];
    

    And if you have a header view that has a hight like the other cells, just add 1 to [number count], that would be like this:

    [tblViewMenu setContentSize:CGSizeMake(320, (([numbers count] + 1) * 32))];
    

提交回复
热议问题