// // JXSecuritySettingVC.m // shiku_im // // Created by p on 2019/4/3. // Copyright © 2019年 Reese. All rights reserved. // #import "JXSecuritySettingVC.h" #import "JXDeviceLockVC.h" #define HEIGHT 50 @interface JXSecuritySettingVC () @end @implementation JXSecuritySettingVC - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.heightHeader = JX_SCREEN_TOP; self.heightFooter = 0; self.isGotoBack = YES; //self.view.frame = g_window.bounds; [self createHeadAndFoot]; self.title = Localized(@"JX_SecuritySettings"); int y = 0; JXImageView *iv = [self createButton:Localized(@"JX_EquipmentLock") drawTop:NO drawBottom:YES must:NO click:@selector(deviceLock:) superView:self.tableBody]; iv.frame = CGRectMake(0,y, JX_SCREEN_WIDTH, HEIGHT); } - (void)deviceLock:(JXImageView *)imageView { JXDeviceLockVC *vc = [[JXDeviceLockVC alloc] init]; [g_navigation pushViewController:vc animated:YES]; } -(JXImageView*)createButton:(NSString*)title drawTop:(BOOL)drawTop drawBottom:(BOOL)drawBottom must:(BOOL)must click:(SEL)click superView:(UIView *)superView{ JXImageView* btn = [[JXImageView alloc] init]; btn.backgroundColor = [UIColor whiteColor]; btn.userInteractionEnabled = YES; if(click) btn.didTouch = click; else btn.didTouch = @selector(hideKeyboard); btn.delegate = self; [superView addSubview:btn]; // [btn release]; if(must){ UILabel* p = [[UILabel alloc] initWithFrame:CGRectMake(INSETS, 5, 20, HEIGHT-5)]; p.text = @"*"; p.font = g_factory.font18; p.backgroundColor = [UIColor clearColor]; p.textColor = [UIColor redColor]; p.textAlignment = NSTextAlignmentCenter; [btn addSubview:p]; // [p release]; } JXLabel* p = [[JXLabel alloc] initWithFrame:CGRectMake(28, 0, 200, HEIGHT)]; p.text = title; p.font = [UIFont systemFontOfSize:16.2]; p.backgroundColor = [UIColor clearColor]; p.textColor = [UIColor blackColor]; [btn addSubview:p]; // [p release]; if(drawTop){ UIView* line = [[UIView alloc] initWithFrame:CGRectMake(0,0,JX_SCREEN_WIDTH,LINE_WH)]; line.backgroundColor = THE_LINE_COLOR; [btn addSubview:line]; // [line release]; } if(drawBottom){ UIView* line = [[UIView alloc]initWithFrame:CGRectMake(0,HEIGHT-LINE_WH,JX_SCREEN_WIDTH,LINE_WH)]; line.backgroundColor = THE_LINE_COLOR; [btn addSubview:line]; // [line release]; } if(click){ UIImageView* iv; iv = [[UIImageView alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH-15-7, (HEIGHT-13)/2, 7, 13)]; iv.image = [UIImage imageNamed:@"new_icon_>"]; [btn addSubview:iv]; // [iv release]; } return btn; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end