UIPrintInfo *pi = [UIPrintInfo printInfo];
pi.outputType = UIPrintInfoOutputGeneral;
pi.jobName = webView.request.URL.absoluteString;
pi.orientation = UIPrintInfoOrientationPortrait;
pi.duplex = UIPrintInfoDuplexLongEdge;
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
pic.printInfo = pi;
pic.showsPageRange = YES;
pic.printFormatter = webView.viewPrintFormatter;
[pic presentAnimated:YES completionHandler:^(UIPrintInteractionController *pic2, BOOL completed, NSError *error) {
// indicate done or error
}];
Showing posts with label webview. Show all posts
Showing posts with label webview. Show all posts
Prevent Launch Browser When Calling loadurl on Webview
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.loadUrl("http://www.example.com");
private class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
Remove Shadow in UIWebview
for(UIView *wview in [[[webview subviews] objectAtIndex:0] subviews]) {
if([wview isKindOfClass:[UIImageView class]]) { wview.hidden = YES; }
}
Labels:
color,
gray,
hide,
iphone SDK,
webview
Get URL that User tap in UIWebView
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
//CAPTURE USER LINK-CLICK.
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
NSURL *URL = [request URL];
if ([[URL scheme] isEqualToString:@"http"]) {
NSLog(@"user tap: %@", [URL absoluteString]);
[[UIApplication sharedApplication] openURL:URL];
}
return NO;
}
return YES;
}
Labels:
iphone SDK,
link,
url,
webview
Disable bouncing UIWebview
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
Labels:
bounce,
iphone SDK,
scroll,
stop,
webview
Subscribe to:
Posts (Atom)