设置与帮助
改动头像, 改动password, 移动客服, 帮助, 声明, 关于我们.


代码

//
//  IndexSetting600ViewController.h
//  SymptomChecker
//
//  Created by wang on 2015-7-21.
//
//#import "CYTableViewController.h"@interface IndexSetting600ViewController : CYTableViewController@end
//
//  IndexSetting600ViewController.m
//  SymptomChecker
//
//  Created by wang on 2015-7-21.
//
//#import "IndexSetting600ViewController.h"
#import "UserCenter600Item.h"#import "UserInfoEditingItem.h" // 改动头像
#import "PortraitPickerViewController.h" // 照片视图#import "ModifyPasswordViewController.h" // 改动password
#import "LocalPasswordViewController.h"#import "CYWebFromLocalViewController.h" // 帮助/声明
#import "CYAboutUsViewController.h" // 关于我们#define kViewRadio viewWidth()/320@interface IndexSetting600ViewController () <PortraitPickerViewControllerDelegate>@end@implementation IndexSetting600ViewController {UserFigureEditingItem *_figureItem; // 改动头像PortraitPickerViewController *_portraitPickerViewController; // 改动头像视图Setting600Item *_changeSecret; // 改动登录passwordSetting600Item *_chunyuTel; // 移动客服Setting600Item *_helpItem; // 帮助Setting600Item *_shengMing; // 声明Setting600Item *_aboutUs; // 关于我们Setting600SeparateItem *_separateItem;  // 空白切割cellFilledColorButton *_logoutButton; // 注销buttonUIView *_logoutFooterView;
}- (id) initWithQuery:(NSDictionary *)query {self = [super initWithQuery: query];if (self) {self.title = @"设置与帮助";[[NSNotificationCenter defaultCenter] addObserver:selfselector:@selector(createModel)name:kRegisterLocalPasswordobject:nil];}return self;
}- (void) dealloc {[[NSNotificationCenter defaultCenter] removeObserver: self];
}- (void) viewDidLoad {[super viewDidLoad];[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];[self createTableItems]; // 确保item已经创建出来
}- (void) viewWillAppear:(BOOL)animated {[super viewWillAppear: animated];
}//
// 创建一次仅仅需
//
- (void) createTableItems {CY_DEFINE_SELF_BAR(self);User* user = [User currentUser];// 改动头像_figureItem = [[UserFigureEditingItem alloc] initWithTitle:@"头像" value:[user.matPhoto getMediaUrl]];[self.tableViewActions attachToObject:_figureItemtapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {[_self editUserFigure];return YES;}];// 改动登录password_changeSecret = [[Setting600Item alloc] initWithTitle: @"改动登录password"];_changeSecret.type = kSetting600Top;[self.tableViewActions attachToObject: _changeSecrettapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {ModifyPasswordViewController *controller = [ModifyPasswordViewController new];[_self cyPresentViewController:controlleranimated:YES];return NO;}];// 移动客服_chunyuTel = [[Setting600Item alloc] initWithTitle: @"移动客服"];_chunyuTel.type = kSetting600Middle;[self.tableViewActions attachToObject: _chunyuTeltapBlock: ^BOOL(id object, id target, NSIndexPath *indexPath) {NSString* feedBackPhoneNumber = @"4001100866";[[UIApplication sharedApplication] openURL:[NSURL URLWithString: [NSString stringWithFormat: @"tel://%@", feedBackPhoneNumber]]];return YES;}];// 帮助_helpItem = [[Setting600Item alloc] initWithTitle: @"帮助"];_helpItem.type = kSetting600Middle;[self.tableViewActions attachToObject: _helpItemtapBlock: ^BOOL(id object, id target, NSIndexPath *indexPath) {CYWebFromLocalViewController* controller = [[CYWebFromLocalViewController alloc] initWithQuery:@{@"title" : @"帮助", @"local_name" : @"help"}];[self.navigationController pushViewController:controller animated:YES];return YES;}];// 声明_shengMing = [[Setting600Item alloc] initWithTitle: @"声明"];_shengMing.type = kSetting600Middle;[self.tableViewActions attachToObject:_shengMingtapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {CYWebFromLocalViewController* controller = [[CYWebFromLocalViewController alloc] initWithQuery:@{@"title" : @"声明", @"local_name" : @"statement"}];[self.navigationController pushViewController:controller animated:YES];return YES;}];// 关于我们_aboutUs = [[Setting600Item alloc] initWithTitle: @"关于我们"];_aboutUs.type = kSetting600Bottom;[self.tableViewActions attachToObject:_aboutUstapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {CYAboutUsViewController* controller = [[CYAboutUsViewController alloc] initWithQuery:@{@"title" : @"关于我们", @"local_name" : @"about"}];[self.navigationController pushViewController:controller animated:YES];return YES;}];// 切割_separateItem = [[Setting600SeparateItem alloc] init];// 底部视图_logoutFooterView = [UIView viewWithFrame:CGRectMake(0, 0, self.view.width, 92*kViewRadio)andBkColor:[UIColor clearColor]];self.tableView.tableFooterView = _logoutFooterView;// 版本号信息UILabel *versionLabel = [UILabel labelWithFrame:CGRectMake(0, 8*kViewRadio, viewWidth(), 12*kViewRadio)fontSize:11fontColor:RGBCOLOR_HEX(0x522121)text:[NSString stringWithFormat: @"当前版本号 :%@", @"1.0.0"]];[versionLabel setTextAlignment:NSTextAlignmentCenter];[_logoutFooterView addSubview:versionLabel];CGRect logoutRect = CGRectMake(16*kViewRadio,versionLabel.bottom+16*kViewRadio,viewWidth()-32*kViewRadio,44*kViewRadio);// 注销button_logoutButton = [[FilledColorButton alloc] initWithFrame: logoutRectcolor: RGBCOLOR_HEX(0xe85454)highlightedColor: RGBCOLOR_HEX(0xa43939)textColor: [UIColor whiteColor]title: @"注销"fontSize: 16*kViewRadioisBold: YES];[_logoutButton addTarget: selfaction: @selector(onLogOutBtnpressed:)forControlEvents: UIControlEventTouchUpInside];[_logoutFooterView addSubview:_logoutButton];}- (void)editUserFigure {_portraitPickerViewController = [[PortraitPickerViewController alloc] initWithParent:self];_portraitPickerViewController.delegate = self;[_portraitPickerViewController showOptions];
}- (void) createModel {NSArray *dataItems;if ([User hasLoggedIn]) {dataItems = @[_separateItem,_figureItem,  // 改动头像_separateItem,_changeSecret,// 改动登录password_chunyuTel,   // 移动客服_helpItem,    // 帮助_shengMing,   // 声明_aboutUs,     // 关于我们_separateItem];} else {_logoutButton.hidden = YES;_logoutFooterView.height = 40;dataItems = @[_separateItem,_chunyuTel,   // 移动客服_helpItem,    // 帮助_shengMing,   // 声明_aboutUs,     // 关于我们_separateItem];}self.tableViewModel = [[NITableViewModel alloc] initWithListArray:dataItemsdelegate:self.cellFactory];
}#pragma mark - btn-selectors
// 点击注销
- (void) onLogOutBtnpressed:(UIButton*) sender {NIDPRINTMETHODNAME();// 登出[[AutoLoginManager sharedInstance] logout];// 更新当前的界面[self createModel];[self backToLastController: nil];// 让别的地方改变UI[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationUserLogoutobject:nil];// 获取未登录的badge[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationCheckBadgeobject:nil];
}@end

效果


转载于:https://www.cnblogs.com/claireyuancy/p/7097190.html

IOS - 设置与帮助界面相关推荐

  1. iOS 设置View阴影

    iOS 设置View投影 需要设置 颜色 阴影半径 等元素 UIView *shadowView = [[UIView alloc] init];shadowView.frame = CGRectMa ...

  2. iOS 设置UILabel 的内边距

    iOS 设置UILabel 的内边距 - (void)drawTextInRect:(CGRect)rect {UIEdgeInsets insets = {0, 5, 0, 5};[super dr ...

  3. iOS 设置app语言中文,比如 copy中文,拍照按钮cancel 中文

    iOS 设置app语言中文,比如 copy中文,拍照按钮cancel 中文 一:如何设置项目中文环境 targets--->Locatization native development reg ...

  4. iOS 设置状态栏样式

    iOS设置状态栏样式可以使用两种方式. 方式一: 直接在需要改变默认状态栏样式的控制器中实现一个方法(其他任何事情都不用做): // 返回状态栏的样式 - (UIStatusBarStyle)pref ...

  5. IOS设置导航栏返回按钮,并添加事件返回主页面

    IOS设置导航栏返回按钮,并添加事件返回主页面 前提是已经push了一个viewController了.才能使用. XXXTableViewController 里面书写 - (void)viewDi ...

  6. IOS设置导航栏的背景图片和文字

    IOS设置导航栏的背景图片和文字 - (void)viewDidLoad {[super viewDidLoad];[self.navigationBar setBackgroundImage:[UI ...

  7. iOS设置拍照retake和use按钮为中文简体

    iOS设置拍照retake和use按钮为中文简体,设置有两种方式一个是代码直接控制,第二就是xcode配置本机国际化为"china"(简体中文). 本文重点要说的是第二种,这样配置 ...

  8. IOS启程06—iOS设置圆角图片

    iOS设置圆角的三种方式 1 方法一 通过设置layer的属性 UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMak ...

  9. Unity 实现跳转ios 设置界面

    Unity 实现跳转ios 设置界面 一.功能需求 iOS网络设置检查,如果没有网络可能是用户选择关闭了 网络链接,ios可以从游戏内直接跳转到设置网络开关. 二.网络检测 直接上代码 public ...

最新文章

  1. 最大后验概率估计算法
  2. C++ 类型转换 :C语言的类型转换、C++的四种强制类型转换、explicit
  3. C# 8 的新提案:new 关键字类型推断
  4. 数据结构之顺序栈的一些基本操作
  5. thrift介绍及应用(一)—介绍
  6. 进阶10 补充知识点
  7. Java 集合系列-第七篇-List总结
  8. 利用wxWindows开发界面程序
  9. 如何抓取蓝光DVD暮光之城月食为DivX AVI格式
  10. java罗马数字_整数转罗马数字以及罗马数字转整数(java实现)
  11. 让你重新爱上 Windows 的小众软件
  12. 【虚拟仿真】Unity3D中实现UI跟随3D模型旋转移动、UI一直面朝屏幕
  13. android模拟器字体,真正免root的ifont字体软件详细使用教程
  14. 智能驾驶软件测试,智能驾驶实车测试系统-VDAS
  15. app登录的token设计
  16. 单片机实例6——报警产生器(硬件电路图+汇编程序+C语言程序)
  17. 绿联扩展坞拆解_我们拆了绿联这款USB
  18. Ext.get()和Ext.getCmp()
  19. java实现飞机大战小游戏——————【附素材、源码、逐行注释讲解】
  20. 为你的SQLite开发选择一款比较好的工具

热门文章

  1. 获取局域网打印机列表
  2. 构建RHEL上的extmail
  3. 产品设计体会(1011)少做就是多做
  4. uploadhandler.php,WordPress Kernel Theme ‘upload-handler.php’任意文件上传漏洞
  5. gprs发送信号对方如何接收_和接收缓冲区比较:Netty发送缓冲区是如何设计的,why?...
  6. 工厂用抽象类比接口_用简单的现实类比解释硬编码概念
  7. 测试开发人员与开发人员_如何升级为开发人员
  8. Python基本知识以及if语句
  9. Linux操作系统(一:基本操作)
  10. Web漏洞扫描(二:Windows server2008 R2操作系统(部署dvwa))