AboutVC.m 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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)viewDidAppear:(BOOL)animated{
  17. [super viewDidAppear:animated];
  18. self.navigationController.navigationBar.alpha = 1.0;
  19. }
  20. - (void)didReceiveMemoryWarning {
  21. [super didReceiveMemoryWarning];
  22. }
  23. -(void)myInit
  24. {
  25. [self setTitle:@"关于"];
  26. [self goBackByNavigation];
  27. UIImageView* iv = [[UIImageView alloc] initWithFrame:CGRectMake(0, -kNavOffSet, kSize.width, kSize.height)];
  28. [iv setImage:[UIImage imageNamed:@"about"]];
  29. [self.view addSubview:iv];
  30. CGFloat x = kSize.width/3.0;
  31. CGFloat w, h;
  32. w = h = x;
  33. UIImageView *logoImg = [[UIImageView alloc] initWithFrame:CGRectMake(x, 100, w, h)];
  34. logoImg.image = [UIImage imageNamed:@"defaultLogo"];
  35. logoImg.layer.masksToBounds = YES;
  36. logoImg.layer.cornerRadius = 3;
  37. [iv addSubview:logoImg];
  38. NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
  39. // app名称
  40. NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
  41. // app版本
  42. NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
  43. NSString *str = [NSString stringWithFormat:@"%@(%@)",app_Name,app_Version];
  44. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(x - 30, 100 + h + 0, w + 60, 50)];
  45. label.backgroundColor = [UIColor clearColor];
  46. [label setText:str Font:24 TextColor:RQMianColor Alignment:NSTextAlignmentCenter];
  47. [iv addSubview:label];
  48. }
  49. @end