We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果我的控制器是UItableViewController呢?或者说需要设置tableView的heander,和Sectionheader这样的话是否需要修改源码处理?
The text was updated successfully, but these errors were encountered:
@al1020119
UITableViewController
非常抱歉,本框架是没有考虑为旧项目动态添加设置行的功能,只有新项目适合用,或者用本框架重写?因为本人就是每到一家公司去,就会用本框架重写,毕竟设置界面没有多少代码,重写的原因是,旧项目很多设置界面是这么写的:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // 太多魔法数字,看得头晕 if(indexPath.section == 0){ if(indexPath.row == 0){ // 跳转到一个控制器 }else if(indexPath.row == 1){ // 跳转到另一个控制器 } } // 。。。其它section和row的情况等等 }
把它改为继承普通的UIViewController,然后导入本框架的UIViewController+XFSettings.h,其步骤请参考快速开始使用文档
UIViewController
UIViewController+XFSettings.h
快速开始使用
这个不需要修改源码,可以直接在控制器viewDidLoad方法里设置self.xf_tableView.tableHeaderView=你的列表头视图,例如:
viewDidLoad
self.xf_tableView.tableHeaderView=你的列表头视图
UIView *headerParentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 88)]; headerParentView.backgroundColor = UIColorFromRGB(CBBackgroundColor); XFSettingHeaderView *settingHeaderView = [XFSettingHeaderView settingHeaderView]; settingHeaderView.size = CGSizeMake(self.view.width, 88); [headerParentView addSubview:settingHeaderView]; self.settingHeaderView = settingHeaderView; self.xf_tableView.tableHeaderView = headerParentView;
这个确实是要修改源码核心内容,因为这是没有考虑在内的,我看过很多设置界面,没有要自定义SectionHeader视图的,如果方便的话,可以发邮件到[email protected],并附上你的设置界面样图。
Sorry, something went wrong.
No branches or pull requests
如果我的控制器是UItableViewController呢?或者说需要设置tableView的heander,和Sectionheader这样的话是否需要修改源码处理?
The text was updated successfully, but these errors were encountered: