当前位置: 首页 > news >正文

cm域名网站做网站费用需要分摊吗

cm域名网站,做网站费用需要分摊吗,傻瓜式做网站,企业网站模板 简洁Tableview时IOS中应用非常广泛的控件#xff0c;当需要动态的添加多条不同的数据时#xff0c;需要用动态表来实现#xff0c;下面给出一个小例子#xff0c;适用于不确定Section的数目#xff0c;并且每个Section中的行数也不同的情况#xff0c;适合新手。首先#xf…Tableview时IOS中应用非常广泛的控件当需要动态的添加多条不同的数据时需要用动态表来实现下面给出一个小例子适用于不确定Section的数目并且每个Section中的行数也不同的情况适合新手。首先我们来看一下效果图模拟器上运行的结果   文件结构   下面来说实现过程首先创建出游记录和出差记录的数据模型 出游记录Travel.h   interface Travel : NSObjectproperty (nonatomic, strong) NSString *country; property (nonatomic, strong) NSString *time; property (nonatomic, strong) NSString *expend; property (nonatomic, strong) NSString *traffic;end 出差记录BusinessTravel.h     interface BusinessTravel : NSObjectproperty (nonatomic, strong) NSString *country; property (nonatomic, strong) NSString *time; property (nonatomic, strong) NSString *expend; property (nonatomic, strong) NSString *traffic; property (nonatomic, strong) NSString *travelReason;end ViewController中为TableView添加数据     interface ViewController ()property(nonatomic,strong) NSMutableArray *travel; property(nonatomic,strong) NSMutableArray *businessTravel;endimplementation ViewController- (void)viewDidLoad {[super viewDidLoad];//初始化数组添加模拟数据self.travel [[NSMutableArray alloc] init];self.businessTravel [[NSMutableArray alloc] init];Travel *t1 [[Travel alloc] init];t1.country 韩国;t1.time 2016.3.10;t1.expend 800;t1.traffic 飞机;[self.travel addObject:t1];Travel *t2 [[Travel alloc] init];t2.country 欧洲;t2.time 2016.3.20;t2.expend 1000;t2.traffic 飞机;[self.travel addObject:t2];BusinessTravel *bt [[BusinessTravel alloc] init];bt.country 日本;bt.time 2016.1.20;bt.expend 1000;bt.traffic 飞机;bt.travelReason 考察;[self.businessTravel addObject:bt];}- (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning]; }#pragma mark - Table view data source//设置Section的数目 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {return (self.travel.count self.businessTravel.count);}//设置每个Section的行数有多少个Section这个方法就执行多少次 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {if (section (self.travel.count)) { //先往Tableview中添加出游记录如果是出游记录返回4行出差记录则返回5行return 4;} else {return 5;}}//设置Section的标题span stylefont-family: Arial, Helvetica, sans-serif;有多少个Section这个方法就执行多少次/span - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {if (section (self.travel.count)) {return 出游记录;} else {return 出差记录;}} //往cell中添加数据 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {UITableViewCell *cell [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];if (cell nil) {cell [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];}if (indexPath.section (self.travel.count)) { //判断Section如果是出游记录则有4行分别添加cell的标题和内容Travel *travel [self.travel objectAtIndex:[indexPath section]];switch (indexPath.row) {case SELECT_INDEX_COUNTRY:cell.textLabel.text 出游国家;cell.detailTextLabel.text travel.country;break;case SELECT_INDEX_TIME:cell.textLabel.text 出游时间;cell.detailTextLabel.text travel.time;break;case SELECT_INDEX_EXPEND:cell.textLabel.text 出游支出;cell.detailTextLabel.text travel.expend;break;case SELECT_INDEX_TRAFFIC:cell.textLabel.text 出游方式;cell.detailTextLabel.text travel.traffic;break;default:break;}} else { //添加出差记录数据BusinessTravel *businessTravel [self.businessTravel objectAtIndex:[indexPath section]-self.travel.count];switch (indexPath.row) {case SELECT_INDEX_BUSINESS_COUNTRY:cell.textLabel.text 出差国家;cell.detailTextLabel.text businessTravel.country;break;case SELECT_INDEX_BUSINESS_TIME:cell.textLabel.text 出差时间;cell.detailTextLabel.text businessTravel.time;break;case SELECT_INDEX_BUSINESS_EXPEND:cell.textLabel.text 出差支出;cell.detailTextLabel.text businessTravel.expend;break;case SELECT_INDEX_BUSINESS_TRAFFIC:cell.textLabel.text 出差方式;cell.detailTextLabel.text businessTravel.traffic;break;case SELECT_INDEX_TRAVEL_REASON:cell.textLabel.text 出差原因;cell.detailTextLabel.text businessTravel.travelReason;break;default:break;}}return cell; }end转载于:https://www.cnblogs.com/ltchu/p/5961565.html
http://www.huolong8.cn/news/145133/

相关文章:

  • 崇州市网站建设网站代理 正规备案
  • 网站设计与建设论文开题报告互联网创业项目ppt模板
  • 课程网站建设课程教你如何建设网站阿里去
  • 建网站就找伍佰亿阿里云oss做视频网站
  • 昆明市门户网站wordpress 备份数据库
  • 变量命名网站wordpress英文版改成中文字体
  • 微网站 php百度收录技巧
  • 山东建设部网站网站建设与网页制作案例教程
  • 网站建设 应酷什么查看WordPress的用户名及密码
  • 前端一般怎样做网站信息系统项目管理
  • 天津网站设计制作公司百度一下建设部网站
  • 网站开发的历史小浪底水利枢纽建设管理局网站
  • 欧美做暖网站html个人网站源码
  • 海南建设银行官网招聘网站深圳团购网站设计价格
  • 长春网站优化实战建设工程教育网电话
  • 国外商业网站建设广州中心网站建设
  • 电子商务毕业设计网站营销咨询公司收费标准
  • 廊坊网站推广排名建设网游小说
  • 商城网站怎么建设常州建设网站
  • 网站建设公司发展理念佛山建网站哪家好
  • 企业网站ui模板下载上海seo整站优化
  • 怎样用织梦建设网站做网站注册的商标类别
  • 做网站业务员应该了解什么服务器网站建设教程视频
  • 站长工具ping公司网址一般是什么
  • 泰安可信赖的企业建站公司产品互联网做推广做什么网站好
  • 广州网站制作系统口碑营销的优点
  • 网站平台建设的当前问题安卓软件开发需要学什么
  • 衡水网站建设推广wordpress 防止爆破插件
  • 网站开发专业课程团智慧团建登录入口
  • 福建省铁路建设办公室网站黑糖不苦还做网站么