//
//  AboutViewController.m
//  gaotingshan
//
//  Created by MacBook Dq01 on 16/5/6.
//  Copyright © 2016年 Xu Mengzhu. All rights reserved.
//

#import "AboutViewController.h"

@interface AboutViewController () <UIWebViewDelegate>

@property (nonatomic, strong) UIWebView *webView;

@end

@implementation AboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"关于";
    
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bg"] forBarMetrics:(UIBarMetricsDefault)];
//    //改变字体颜色.
//    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
//    textAttrs[NSForegroundColorAttributeName] = [UIColor whiteColor];
//    self.navigationController.navigationBar.titleTextAttributes = textAttrs;
    
    [Manager setNavi:self.navigationController.navigationBar];
    
#pragma - 设置导航栏左边的按钮
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"nav_back.png"] landscapeImagePhone:nil style:UIBarButtonItemStylePlain target:self action:@selector(aboutLeftBtnItemIsClicked)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];

    
//    _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64)];
//    [_webView setUserInteractionEnabled:YES];//是否支持交互
//    _webView.backgroundColor = [UIColor whiteColor];
//    [_webView setOpaque:NO]; //opaque是不透明的意思
//    [_webView setScalesPageToFit:YES]; //自动缩放以适应屏幕
    
    _webView = [Manager screenFrameWebview];
    _webView.delegate = self;
    [self.view addSubview:_webView];
    //加载网页的方式
    //1.创建并加载远程网页
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/terminal/about",localRequestUrl]];
    [_webView loadRequest:[NSURLRequest requestWithURL:url]];
    
}


#pragma mark - 导航栏左边按钮被点击
- (void)aboutLeftBtnItemIsClicked {
    
    [self dismissViewControllerAnimated:NO completion:nil];
    
}


/////////
- (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
