123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- //
- // ZBSetViewController.m
- // ZBProject
- //
- // Created by 学丽 on 2019/4/4.
- // Copyright © 2019 ZB. All rights reserved.
- //
- #import "ZBSetViewController.h"
- #import "ZBSetListCell.h"
- @interface ZBSetViewController ()<UITableViewDelegate,UITableViewDataSource>
- @property(nonatomic,strong)UITableView *tableViews;
- @end
- @implementation ZBSetViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self initNavs];
- }
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return 1;
- }
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- ZBSetListCell *cell =[tableView dequeueReusableCellWithIdentifier:@"cell"];
- if (!cell) {
- cell =[[ZBSetListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
- cell.accessoryType=UITableViewCellAccessoryNone;
- }
- cell.selectionStyle=UITableViewCellSelectionStyleNone;
- cell.backgroundColor=[UIColor whiteColor];
- return cell;
- }
- -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- return 1;
- }
- -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- {
- return 10;
- }
- -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- return 50;
- }
- -(void)initNavs
- {
- // [self.navBar setShowNavigationBarBottomLine:YES];
- [UIApplication sharedApplication].statusBarStyle=UIStatusBarStyleDefault;
- self.navBar.backgroundColor=[UIColor whiteColor];
- self.view.backgroundColor=[UIColor lineColor];
- self.navBar.navTitleLabel.text=@"设置";
- self.navBar.navTitleLabel.textColor=[UIColor YHColorWithHex:0x333333];
- UIButton *returnBtn =[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 20)];
- [returnBtn addTarget:self action:@selector(returnClickBtn) forControlEvents:UIControlEventTouchUpInside];
- [returnBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
- returnBtn.adjustsImageWhenHighlighted = NO;
- [self.navBar setCustomLeftButtons:@[returnBtn]];
- [self.view addSubview:self.tableViews];
- [self.tableViews mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.mas_equalTo(0);
- make.top.mas_equalTo(NavBarHeight);
-
- make.height.mas_equalTo(SCREEN_HEIGHT);
- }];
-
- UIButton *exitBtn =[[UIButton alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT-50-SafeBottomHeight, SCREEN_WIDTH, 50)];
- [exitBtn setTitle:@"退出登录" forState:UIControlStateNormal];
- exitBtn.backgroundColor=[UIColor whiteColor];
- [exitBtn addTarget:self action:@selector(exitClickBtn) forControlEvents:UIControlEventTouchUpInside];
- [exitBtn setTitleColor:[UIColor YHColorWithHex:0xFF7D00] forState:UIControlStateNormal];
- [self.view addSubview:exitBtn];
-
- }
- #pragma mark---退出登录
- -(void)exitClickBtn
- {
- [[NSNotificationCenter defaultCenter]postNotificationName:@"logout" object:nil userInfo:nil];
- [self.navigationController popViewControllerAnimated:YES];
- [AccountTool deleteAccount];
- UINavigationController *login = [[UINavigationController alloc]initWithRootViewController:[[ZBLoginViewController alloc] init]];
- [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:login animated:YES completion:nil];
- }
- -(void)returnClickBtn
- {
- [self.navigationController popViewControllerAnimated:YES];
- }
- -(UITableView *)tableViews
- {
- if (!_tableViews) {
- _tableViews =[[UITableView alloc]init];
- _tableViews.delegate =self;
- _tableViews.dataSource=self;
- _tableViews.separatorStyle=UITableViewCellSeparatorStyleNone;
-
- _tableViews.backgroundColor=[UIColor YHColorWithHex:0xF2F2F2];
- _tableViews.sectionHeaderHeight=10;
- }
- return _tableViews;
- }
- @end
|