//
// 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
]]>
版权归属:
姚凌武
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区