AboutVC.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // AboutVC.m
  3. // jiaPei
  4. //
  5. // Created by apple on 15/11/18.
  6. // Copyright (c) 2015年 JCZ. All rights reserved.
  7. //
  8. #import "AboutVC.h"
  9. @interface AboutVC ()
  10. @end
  11. @implementation AboutVC
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. [self myInit];
  15. }
  16. - (void)didReceiveMemoryWarning {
  17. [super didReceiveMemoryWarning];
  18. }
  19. -(void)myInit
  20. {
  21. [self setTitle:@"关于我们"];
  22. self.view.backgroundColor = [UIColor whiteColor];
  23. UIImageView* iv = [[UIImageView alloc] initWithFrame:CGRectMake(0, -kNavOffSet, kSize.width, kSize.height)];
  24. [iv setImage:[UIImage imageNamed:@"about"]];
  25. [self.view addSubview:iv];
  26. CGFloat x = kSize.width/3.0;
  27. CGFloat y = 40;
  28. CGFloat w, h;
  29. w = h = x;
  30. UIImageView *logoImg = [[UIImageView alloc] initWithFrame:CGRectMake(x, y, w, h)];
  31. logoImg.image = [UIImage imageNamed:@"defaultLogo"];
  32. logoImg.layer.masksToBounds = YES;
  33. logoImg.layer.cornerRadius = 5;
  34. [self.view addSubview:logoImg];
  35. NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
  36. // app名称
  37. NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
  38. // app版本
  39. NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
  40. NSString *str = [NSString stringWithFormat:@"%@(%@)",app_Name,app_Version];
  41. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(x - 30, y + h + 0, w + 60, 50)];
  42. label.backgroundColor = [UIColor clearColor];
  43. [label setText:str Font:24 TextColor:RGB_COLOR(17, 101, 120) Alignment:NSTextAlignmentCenter];
  44. [self.view addSubview:label];
  45. }
  46. @end