// // privacy_VC.m // Haishenghai-master // // Created by 刘云鸽 on 2019/3/15. // Copyright © 2019 Haishenghai intelligence network technology. All rights reserved. // #import "privacy_VC.h" #import #import @interface privacy_VC () @end @implementation privacy_VC - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //方法二 用QLPreviewController方法加载Word文本 self.navigationItem.title = @"隐私政策"; self.view.backgroundColor = [UIColor whiteColor]; self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:60/255.0 green:114/255.0 blue:255/255.0 alpha:1]; [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}]; self.view.backgroundColor = [UIColor whiteColor]; UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [backBtn setImage:[UIImage imageNamed:@"hsh_return"] forState:UIControlStateNormal]; backBtn.frame = CGRectMake(0, 0, 44, 44); [backBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside]; backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn]; // [self QLPreviewControllerLoad]; [self webViewLoad]; } -(void)backClick{ [self.navigationController popViewControllerAnimated:YES]; } //第二种方法加载 -(void)webViewLoad{ WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.hsh-iot.com/app_page/hshyszc.html"]]]; [self.view addSubview:webView]; } //-(void)QLPreviewControllerLoad{ // QLPreviewController *Ql = [[QLPreviewController alloc]init]; // Ql.dataSource =self; // [self presentViewController:Ql animated:YES completion:nil]; //} //#pragma mark ---dataSource //-(NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller{ // return 1; //} //-(id)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index{ // NSString *path = [[NSBundle mainBundle]pathForResource:@"hsh_protcol1.docx" ofType:nil]; // NSURL *url = [NSURL fileURLWithPath:path]; // return url; //} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end