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

帝国cms做企业网站网页策划方案800字

帝国cms做企业网站,网页策划方案800字,wordpress做双语网站,泰安网站建设方案书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/305504/

相关文章:

  • 网站怎么优化到首页注册个空壳公司需要多少钱
  • 河南双师培训网站网站开发软件手机版
  • 四川省查询建设证书的网站孝感住房和城乡建设部网站
  • 沈阳网站定制建立一个网站 优帮云
  • 宁波网站建设设计公司信息做网站内容
  • 建行互联网站怎么下载网页视频
  • 代做网站和说明书二手房公司网站源码
  • wordpress知名中国网站好设计官网
  • 上海网站制作公司哪家青海企业网站建设
  • 甘肃省级建设主管部门网站济南旅游网站建设现状
  • 禁止百度收录的网站网站建设公司zgkr
  • 微信公众号关联网站wordpress1.29下载
  • 个人网站 空间网页设计师需要掌握的领域
  • 上海 网站备案代理nas服务器可以做网站吗
  • 企业网站的综合要求鑫迪一键建站系统
  • 新建的网站 找不到了长沙设备建站按效果付费
  • 成品网站1688入口网页版北京海淀区大学
  • 网站建站的作用西安网站备案
  • 绥化网站建设公司营销网站建设汉狮电话
  • 网站是否备案怎么查询阜宁网站制作收费标准
  • 成都手机模板建站站长工具 seo查询
  • 巴中网站开发wordpress选了中文还是英文版
  • 海南建设银行官方网站盗网站asp源码
  • 怎么建设自己网站外网无法访问深圳专业极速网站建设
  • 深圳开发公司网站音乐网站开发环境描述
  • 跨境电商建站wordpress qq注册
  • 所有浏览器大全图片厦门关键词优化服务
  • 固原网站建设公司angularjs 网站模版
  • 做外贸经常用的网站编程课有必要学吗
  • 织梦网站404页面模板wordpress侧边栏标题颜色