privacy_VC.m 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // privacy_VC.m
  3. // Haishenghai-master
  4. //
  5. // Created by 刘云鸽 on 2019/3/15.
  6. // Copyright © 2019 Haishenghai intelligence network technology. All rights reserved.
  7. //
  8. #import "privacy_VC.h"
  9. #import <QuickLook/QuickLook.h>
  10. #import <WebKit/WebKit.h>
  11. @interface privacy_VC ()<QLPreviewControllerDataSource>
  12. @end
  13. @implementation privacy_VC
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. //方法二 用QLPreviewController方法加载Word文本
  18. self.navigationItem.title = @"隐私政策";
  19. self.view.backgroundColor = [UIColor whiteColor];
  20. self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:60/255.0 green:114/255.0 blue:255/255.0 alpha:1];
  21. [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
  22. self.view.backgroundColor = [UIColor whiteColor];
  23. UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  24. [backBtn setImage:[UIImage imageNamed:@"hsh_return"] forState:UIControlStateNormal];
  25. backBtn.frame = CGRectMake(0, 0, 44, 44);
  26. [backBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
  27. backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
  28. self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
  29. // [self QLPreviewControllerLoad];
  30. [self webViewLoad];
  31. }
  32. -(void)backClick{
  33. [self.navigationController popViewControllerAnimated:YES];
  34. }
  35. //第二种方法加载
  36. -(void)webViewLoad{
  37. WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds];
  38. [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.hsh-iot.com/app_page/hshyszc.html"]]];
  39. [self.view addSubview:webView];
  40. }
  41. //-(void)QLPreviewControllerLoad{
  42. // QLPreviewController *Ql = [[QLPreviewController alloc]init];
  43. // Ql.dataSource =self;
  44. // [self presentViewController:Ql animated:YES completion:nil];
  45. //}
  46. //#pragma mark ---dataSource
  47. //-(NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller{
  48. // return 1;
  49. //}
  50. //-(id<QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index{
  51. // NSString *path = [[NSBundle mainBundle]pathForResource:@"hsh_protcol1.docx" ofType:nil];
  52. // NSURL *url = [NSURL fileURLWithPath:path];
  53. // return url;
  54. //}
  55. - (void)didReceiveMemoryWarning {
  56. [super didReceiveMemoryWarning];
  57. // Dispose of any resources that can be recreated.
  58. }
  59. /*
  60. #pragma mark - Navigation
  61. // In a storyboard-based application, you will often want to do a little preparation before navigation
  62. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  63. // Get the new view controller using [segue destinationViewController].
  64. // Pass the selected object to the new view controller.
  65. }
  66. */
  67. @end