侧边栏壁纸
博主头像
最闪啊姚凌武!博主等级

天下武功,唯快不破

  • 累计撰写 293 篇文章
  • 累计创建 34 个标签
  • 累计收到 10 条评论

目 录CONTENT

文章目录

UITableView

姚凌武
2014-09-24 / 0 评论 / 0 点赞 / 15 阅读 / 16299 字
// // FFSettingVC.m // SelfService // // Created by noway on 14-9-22. // Copyright (c) 2014年 Beijing ShiShiKe Technologies Co., Ltd. All rights reserved. // #import "FFSettingVC.h" #import "FFBLEPrinterSettingVC.h" @interface FFSettingVC () <UITableViewDataSource, UITableViewDelegate> @property(nonatomic, strong) UITableView *contentView; @property(nonatomic, strong) NSArray *list; @end @implementation FFSettingVC - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; NSArray *array = @[ @"还原(慎用!会抹掉所有内容和设置)", @"打印机设置", @"版本号" ]; self.list = array; [self setup]; } #pragma mark create View - (void)setup { self.navTitle = @"设置"; [self createTableView]; } - (void)createTableView { CGRect frame = (CGRect) {0, PopupNavBarHeight, self.view.frameWidth, self.view.frameHeight - PopupNavBarHeight}; self.contentView = [[[UITableView alloc] initWithFrame:frame style:UITableViewStyleGrouped] autorelease]; self.contentView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; self.contentView.delegate = self; self.contentView.dataSource = self; self.contentView.backgroundColor = [UIColor clearColor]; self.contentView.alpha = 0.8f; [self.view addSubview:self.contentView]; } #pragma mark UItableview delegate - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return _list.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *TableSampleIdentifier = @"TableSampleIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: TableSampleIdentifier]; if (!cell) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TableSampleIdentifier] autorelease]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } if (indexPath.row == 0)cell.accessoryType = UITableViewCellAccessoryNone; cell.textLabel.text = (self.list)[[indexPath row]]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { switch (indexPath.row) { case 0: break; case 1: //打印机设置 [self.navigationController pushViewController:[[[FFBLEPrinterSettingVC alloc] init] autorelease] animated:YES]; break; case 2: break; default: break; } } #pragma mark 自定义 - (UIColor *)customTitleColor { return HexRGBA(0xEA, 0x5A, 0x53, 255); } @end ]]>
0
iOS

评论区