AboutViewController.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // AboutViewController.m
  3. // Apex Mobile
  4. //
  5. // Created by Ray on 14-2-26.
  6. // Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "AboutViewController.h"
  9. @interface AboutViewController ()
  10. @end
  11. @implementation AboutViewController
  12. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  13. {
  14. self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  15. if (self) {
  16. // Custom initialization
  17. }
  18. return self;
  19. }
  20. - (BOOL)shouldAutorotate
  21. {
  22. return YES;
  23. }
  24. - (NSUInteger)supportedInterfaceOrientations
  25. {
  26. return UIInterfaceOrientationMaskPortrait;
  27. }
  28. - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
  29. {
  30. return UIInterfaceOrientationPortrait;
  31. }
  32. - (void)viewDidLoad
  33. {
  34. [super viewDidLoad];
  35. NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
  36. NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];
  37. versionNum = [NSString stringWithFormat:@"A%@",versionNum];
  38. self.infoText.text = [NSString stringWithFormat:@"Version:%@\nSupport:\nusairedadt@united-us.net",versionNum];
  39. NSString *filePath = [[NSBundle mainBundle]pathForResource:@"about" ofType:@"htm"];
  40. NSString *htmlString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
  41. [self.webview loadHTMLString:htmlString baseURL:[NSURL URLWithString:filePath]];
  42. // Do any additional setup after loading the view.
  43. }
  44. - (void)didReceiveMemoryWarning
  45. {
  46. [super didReceiveMemoryWarning];
  47. // Dispose of any resources that can be recreated.
  48. }
  49. - (void)webViewDidFinishLoad:(UIWebView *)webView
  50. {
  51. // finished loading, hide the activity indicator in the status bar
  52. [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
  53. [self.webview stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '350%'"];
  54. }
  55. @end