我已经创建了一个UIview类Xib,以在表的页脚视图中显示它。
import UIKit
/// This class is to display footer view in a settings table view
class FooterView: UIView {
override func awakeFromNib() {
super.awakeFromNib()
}
}
我把它展示如下:
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int
我有一个分组的UITableView,其中不是所有的部分都可以一次显示,表由一些数据驱动,而不是每条记录都有。我的问题是,没有特定部分的记录在表中显示为空格(见图)
没有页脚/页眉。我错过了什么吗?
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return [self getRowCount:section];
}
// Customize the appeara
我有一个带有页脚的UITableView,在自定义视图中填充了一个tabBar,使用以下代码完成:
- (CGFloat)tableView:(UITableView *)tableView
heightForFooterInSection:(NSInteger)section {
//differ between your sections or if you
//have only on section return a static value
return 49;
}
- (UIView *)tableView:(UITableView *)tableView
两天来,我一直在努力解决这个问题。我只想在我的表视图中添加一个页脚(自定义单元格)。我有一个视图,上面有一些东西(标签,按钮),我还添加了一个表视图。为了有一个干净的控制器,对于数据源,我使用了一个单独的文件:
class MyDataSource: NSObject, UITableViewDataSource, UITableViewDelegate {
...
}
在我的控制器中,我有:
class MyViewController: UIViewController {
@IBOutlet weak var myButton: UIButton!
var my