zhy*_*r28 2 iphone objective-c uitableview ios
我想在最后添加一个加载更多按钮UITableview.它具有与Instagram中的load-more按钮相同的功能.这是照片.

所以我的问题是如何在最后添加它UITableview?由于tableview是可滚动的,我不知道如何给按钮一个动态位置.
提前致谢.
创建一个空的UIView:UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 70)];
创建你的按钮:
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"Load More" forState:UIControlStateNormal];
[button addTarget:self action:@selector(buttonLoadMoreTouched) forControlEvents:UIControlEventTouchUpInside];
[button sizeToFit];
Run Code Online (Sandbox Code Playgroud)
从1添加按钮作为视图的子视图.
[v addSubview:button];
Run Code Online (Sandbox Code Playgroud)
将表的tableFooterView属性设置为1中的视图.
self.myTableView.tableFooterView = v;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2566 次 |
| 最近记录: |