JXSecuritySettingVC.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //
  2. // JXSecuritySettingVC.m
  3. // shiku_im
  4. //
  5. // Created by p on 2019/4/3.
  6. // Copyright © 2019年 Reese. All rights reserved.
  7. //
  8. #import "JXSecuritySettingVC.h"
  9. #import "JXDeviceLockVC.h"
  10. #define HEIGHT 50
  11. @interface JXSecuritySettingVC ()
  12. @end
  13. @implementation JXSecuritySettingVC
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. self.heightHeader = JX_SCREEN_TOP;
  18. self.heightFooter = 0;
  19. self.isGotoBack = YES;
  20. //self.view.frame = g_window.bounds;
  21. [self createHeadAndFoot];
  22. self.title = Localized(@"JX_SecuritySettings");
  23. int y = 0;
  24. JXImageView *iv = [self createButton:Localized(@"JX_EquipmentLock") drawTop:NO drawBottom:YES must:NO click:@selector(deviceLock:) superView:self.tableBody];
  25. iv.frame = CGRectMake(0,y, JX_SCREEN_WIDTH, HEIGHT);
  26. }
  27. - (void)deviceLock:(JXImageView *)imageView {
  28. JXDeviceLockVC *vc = [[JXDeviceLockVC alloc] init];
  29. [g_navigation pushViewController:vc animated:YES];
  30. }
  31. -(JXImageView*)createButton:(NSString*)title drawTop:(BOOL)drawTop drawBottom:(BOOL)drawBottom must:(BOOL)must click:(SEL)click superView:(UIView *)superView{
  32. JXImageView* btn = [[JXImageView alloc] init];
  33. btn.backgroundColor = [UIColor whiteColor];
  34. btn.userInteractionEnabled = YES;
  35. if(click)
  36. btn.didTouch = click;
  37. else
  38. btn.didTouch = @selector(hideKeyboard);
  39. btn.delegate = self;
  40. [superView addSubview:btn];
  41. // [btn release];
  42. if(must){
  43. UILabel* p = [[UILabel alloc] initWithFrame:CGRectMake(INSETS, 5, 20, HEIGHT-5)];
  44. p.text = @"*";
  45. p.font = g_factory.font18;
  46. p.backgroundColor = [UIColor clearColor];
  47. p.textColor = [UIColor redColor];
  48. p.textAlignment = NSTextAlignmentCenter;
  49. [btn addSubview:p];
  50. // [p release];
  51. }
  52. JXLabel* p = [[JXLabel alloc] initWithFrame:CGRectMake(28, 0, 200, HEIGHT)];
  53. p.text = title;
  54. p.font = [UIFont systemFontOfSize:16.2];
  55. p.backgroundColor = [UIColor clearColor];
  56. p.textColor = [UIColor blackColor];
  57. [btn addSubview:p];
  58. // [p release];
  59. if(drawTop){
  60. UIView* line = [[UIView alloc] initWithFrame:CGRectMake(0,0,JX_SCREEN_WIDTH,LINE_WH)];
  61. line.backgroundColor = THE_LINE_COLOR;
  62. [btn addSubview:line];
  63. // [line release];
  64. }
  65. if(drawBottom){
  66. UIView* line = [[UIView alloc]initWithFrame:CGRectMake(0,HEIGHT-LINE_WH,JX_SCREEN_WIDTH,LINE_WH)];
  67. line.backgroundColor = THE_LINE_COLOR;
  68. [btn addSubview:line];
  69. // [line release];
  70. }
  71. if(click){
  72. UIImageView* iv;
  73. iv = [[UIImageView alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH-15-7, (HEIGHT-13)/2, 7, 13)];
  74. iv.image = [UIImage imageNamed:@"new_icon_>"];
  75. [btn addSubview:iv];
  76. // [iv release];
  77. }
  78. return btn;
  79. }
  80. /*
  81. #pragma mark - Navigation
  82. // In a storyboard-based application, you will often want to do a little preparation before navigation
  83. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  84. // Get the new view controller using [segue destinationViewController].
  85. // Pass the selected object to the new view controller.
  86. }
  87. */
  88. @end