uiwebview

How can I perform Paging in UIWebView?

☆樱花仙子☆ 提交于 2019-12-08 07:50:29
问题 I have ten local HTML files in my Resource folder and I want to performing paging effect like ScrollView and ImageView so please help me how I can do that. I have displayed HTML page in webView , but i don't have any more ideas. My code is (but it's for only One page): arrHtmlPage=[[NSMutableArray alloc] initWithObjects:@"2",@"3",@"5",@"6",@"8",@"9",@"11",@"13",nil]; NSBundle *bundle = [NSBundle mainBundle]; NSString *htmlTemplateLink = [bundle pathForResource:@"2" ofType:@"htm"];

JavaScriptCore — Passing a function as a parameter to ObjC

纵然是瞬间 提交于 2019-12-08 07:35:33
问题 I have a UIWebView that utilizes JavaScriptCore. I'm trying to call an ObjC function from an web page. However, the function needs to be call asynchronously, so I'm passing in a callback function that is called when the async ObjC function is called. It is my understanding that JS functions are equivalent to NSBlock via the bridge. The current code I have is: context[@"currentUserLocation"] = ^( void(^callback)(NSString* str) ) { NSLog(@"Starting Async Function"); //generic async function

HTML5 AppCache in UIWebView

亡梦爱人 提交于 2019-12-08 07:10:39
问题 I'd like to make use of appcache in my native application on the iPhone. Though Mobile Safari supports appcache it seems that the UIWebView that you can embed in an application does not. I know with a bit of work, I could simulate some sort of appcache like functionality in my application, but this isn't good enough - I'd like access to the same appcache that Mobile Safari uses. I'd be willing to use some of the Private Frameworks in the iPhone SDK, as getting this working is a much higher

how to get proper UIWebView content height?

≡放荡痞女 提交于 2019-12-08 06:43:09
问题 I am add UIWebView in View and That view in ScrollView. I want to get frame of the UIWebView Content. So can I set the frame to view and scrollview? I know we can get the height by using javascript. As mention below: float height = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight;"] floatValue]; But when I am rotating the view and recalculate the height of the UIWebView content in didRotateFromInterfaceOrientation::(UIInterfaceOrientation)fromInterfaceOrientation

Opening tel: links from UIWebView

孤人 提交于 2019-12-08 06:40:03
问题 I've searched and searched, but I can't seem to find a fix for this problem. For some reason, I can not get 'tel:' links to work in a UIWebView. When the links are clicked, the message "The URL can't be shown" appears. Clicking on the same link in Safari works perfectly and dials the number. This problem started with iOS 5. These links worked perfectly in iOS 4.2 and 4.3. I'm not sure what other information might be useful, so please let me know if I need to clarify. Thanks! EDIT: Here is the

Communication between javascript and Objective-c (IOS)

空扰寡人 提交于 2019-12-08 06:30:07
问题 I know the way to communicate between iOS and javascript is to create fake URLs in JS and append a string which will be used as parameter to the Objective-C code and parse that URL in this delegate method: -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType Then send the return value by calling the native method stringByEvaluatingJavaScriptFromString again with parameter callID. But I want to, just like

Modify URL request in shouldStartLoadWithRequest method and displaying in Webview

若如初见. 提交于 2019-12-08 06:08:52
问题 I have one webview and 3 url. So when application starts i am showing URL1 in webview. Now when i select any portion of webview it will redirect to URL2. But only i want to fetch some data from URL2 and dont want to show it to user. Which i can able to do by using shouldStartLoadWithRequest: method with return NO. but Now i need to show URL 3 with data received from URL2 in my Webview. But it is not showing anything ,how can i do it ? For this i am using following code -(void)viewDidLoad { /

How to stream video over secure connection on iOS

对着背影说爱祢 提交于 2019-12-08 06:01:41
问题 I can play a video from a local resource (on the device). I can stream a video from the unprotected internet. I can't stream from the company intranet (either from internal or externally) Typical secure company network. Videos are stored in SharePoint 2007 lists (but I have url to the video file). I've tried: MPMoviePlayerController MPMoviePlayerViewController UIViewView (creating html on fly using the <video> tag and video url) and I can't get anything to work. Heck, I can't even get it to

UIWebView contextual menu while displaying PDF content

半世苍凉 提交于 2019-12-08 05:26:50
问题 In my application, I use UIWebView to display different types of files like, html, pdf, doc etc. I am customizing the contextual menu on html content, by disabling callout and using gesture recognizer. It works fine for html content. However when displaying pdf content web view uses different classes from corepdf framework which is private framework. So none of the technique which worked on html content works with pdf content. UIWebView uses UIPDFPageView and related classes to display

Embedded UIWebView YouTube Volume

牧云@^-^@ 提交于 2019-12-08 05:14:07
问题 I'm working on an iOS app that can display YouTube videos in a UIWebView. Everything is working great except... The first time a video is played it plays at ~10% volume. The device volume is set at 100% and the player volume shows 100% in the UI. Backing out of the web view and play a song in the app using our native streaming player then go back to the video it plays at the correct volume. Things that don't work... - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [