|
|
@@ -72,6 +72,23 @@
|
|
|
self.navigationItem.rightBarButtonItems =items;
|
|
|
|
|
|
|
|
|
+ if (self.navigationController.viewControllers[0]==self )
|
|
|
+ {
|
|
|
+ UIBarButtonItem *closeButton =nil;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ closeButton=[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
|
|
|
+ style:UIBarButtonItemStylePlain
|
|
|
+ target:self
|
|
|
+ action:@selector( onCloseClick:)];
|
|
|
+ //[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Close", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onCloseClick:)];
|
|
|
+ // closeButton.title = @"Close";
|
|
|
+
|
|
|
+ self.navigationItem.leftBarButtonItem = closeButton;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -152,6 +169,11 @@
|
|
|
|
|
|
[self.navigationController popViewControllerAnimated:FALSE];
|
|
|
}
|
|
|
+- (void)onCloseClick:(UIButton *)sender {
|
|
|
+
|
|
|
+ [self dismissViewControllerAnimated:false completion:nil];
|
|
|
+ //[self.navigationController popViewControllerAnimated:FALSE];
|
|
|
+}
|
|
|
-(void)ReloadData
|
|
|
{
|
|
|
|
|
|
@@ -253,11 +275,15 @@
|
|
|
self.btnemail.enabled =true;
|
|
|
self.btnsave.enabled =true;
|
|
|
|
|
|
- if(self.onLoadSuccess)
|
|
|
- self.onLoadSuccess(self.url);
|
|
|
|
|
|
- if(self.autoPrint)
|
|
|
- [self startAirPrintWithData:self.content];
|
|
|
+
|
|
|
+ NSURL *url = [NSURL fileURLWithPath:filePath];
|
|
|
+ NSURLRequest *request = [NSURLRequest requestWithURL:url];
|
|
|
+ [self.webView loadRequest:request];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
// int a=0;
|
|
|
@@ -277,7 +303,7 @@
|
|
|
|
|
|
// DebugLog(urlResponse.MIMEType);
|
|
|
|
|
|
- [self.webView loadData:self.content MIMEType:urlResponse.MIMEType textEncodingName:nil baseURL:nil];
|
|
|
+// [self.webView loadData:self.content MIMEType:urlResponse.MIMEType textEncodingName:nil baseURL:nil];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -647,8 +673,17 @@
|
|
|
self.mum.hidden=true;
|
|
|
|
|
|
|
|
|
+ if(self.onLoadSuccess)
|
|
|
+ self.onLoadSuccess(self.url);
|
|
|
+
|
|
|
+ if(self.autoPrint)
|
|
|
+ [self startAirPrintWithData:self.content];
|
|
|
+
|
|
|
+}
|
|
|
+- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
|
|
|
+{
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
#pragma mark -MFMailComposeViewControllerDelegate delegate
|
|
|
|
|
|
- (void)mailComposeController:(MFMailComposeViewController*)controller
|