uiwebview

iOS 7 UIWebView not rendering

≡放荡痞女 提交于 2019-11-30 06:20:38
I'm porting my app to iOS 7 and I have a problem with UIWebView in iOS 7. I load local html string in it with this code: NSURL *baseURL = [NSURL fileURLWithPath: DOCUMENTS_DIRECTORY]; [self.descWebView loadHTMLString:html baseURL:baseURL]; It works perfectly on iOS 6 and prior but on iOS 7 it doesn't rendering and the UIWebView is still white. And this message appears in console: void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode Thanks

iphone - Getting data from uiwebview textfield

与世无争的帅哥 提交于 2019-11-30 06:17:34
问题 Am developing an app which load a HTML page into uiwebview - that html file contains text-filed and drop-down list, text-boxes etc.. Here How to get values which user has entered in that text-filed and answers selected from drop-down(picker). Thanks 回答1: You can use [UIWebView stringByEvaluatingJavascriptFromString:] method and get the values by executing the javascript. Example: If your html is: <html> <body> <input id="myId" type="text" value="TextValue"/> </body> </html> Following code can

UIWebView webViewDidFinishLoad not getting called iOS

余生长醉 提交于 2019-11-30 05:59:27
I am loading some file from document directory using UIWebView. I have set the delegate of UIWebView and I am responding to 2 methods of delegate that is webViewDidStartLoad and webViewDidFinishLoad I am receiving the webViewDidStartLoad But I am not receiving webViewDidFinishLoad method. Below is the code: @interface MyView: UIViewController <UIWebViewDelegate> { UIWebView *webView; } @property (nonatomic, retain) UIWebView *webView; ========================= Class =========================== -(void)viewDidLoad { CGRect webFrame = [[UIScreen mainScreen] applicationFrame]; mWebView = [

Javascript core crash when using YouTube iframe player in UIWebView in iOS 11.3

自闭症网瘾萝莉.ら 提交于 2019-11-30 05:45:10
We have an iOS app with a UIWebView that loads YouTube iframe player to play youtube videos. After iOS 11.3 released we found that there are a lot of javascript core crashes. On Fabric crashlytics the crash stcktrace looks like this Crashed: WebThread 0 JavaScriptCore 0x18aa48298 JSC::JSLock::DropAllLocks::DropAllLocks(JSC::VM&) + 176 1 JavaScriptCore 0x18aa4826c JSC::JSLock::DropAllLocks::DropAllLocks(JSC::VM&) + 132 2 WebCore 0x18b78b794 SendDelegateMessage(NSInvocation*) + 360 3 WebKitLegacy 0x18cea7c68 CallDelegate(void (*)(), WebView*, objc_object*, objc_selector*, objc_object*, objc

Opening a new UIViewController when a link on a UIWebView is clicked

时光毁灭记忆、已成空白 提交于 2019-11-30 05:31:16
I found this thread which matches my problem: Clicking a link in UIWebView pushes onto the NavigationView stack However, the following situations are different: Instead of using a navigationController, I am using a View Based application to manually switch to different viewcontroller when corresponding buttons are pressed. Rather than using links I am using onClick method to detect when a user clicks on something on a UIWebView and trying to open a new ViewController with a new UIWebView. Will the same code work or do i have to make some changes? You will have to do some modifications 1st:

Injecting CSS into UIWebView using JavaScript

橙三吉。 提交于 2019-11-30 05:26:05
I am attempting to inject a local CSS file to override the styling of a webpage. The webpage is presented in a UIWebView container in iOS. However I am not able to get my code to work. See the snippet of my delegate method below. This code runs (I can see the NSLog message) but I do not see the results of it's execution on the page. I know it can't be the CSS I wrote because in this case I took the pages own CSS file and simply changed some colors. (In order to test this method) -(void)webViewDidFinishLoad:(UIWebView *)webView { NSString *path = [[NSBundle mainBundle] bundlePath]; NSString

Cordova + Crosswalk iOS still using UIWebView

放肆的年华 提交于 2019-11-30 05:26:04
I didn't find a lot of instruction setting up crosswalk for iOS it seems like it should be as simple as: cordova plugin add cordova-plugin-crosswalk-webview cordova build ios Because I've had issues with plugins not taking effect before I do the following: cordova plugin add cordova-plugin-crosswalk-webview cordova platform remove ios cordova platform add ios cordova build ios After having done this, when I capture the view hierarchy and inspecting that it's still using "UIWebView" which has a "UIWebBrowserView" inside of it (which is inside of a scroll view and there are a couple image views

Objective-C Issues with UIWebView to PDF

旧时模样 提交于 2019-11-30 04:55:09
问题 I have this method here that takes my UIWebView and convert into a PDF and its working well. But when I print off this PDF or email it, its cut off. Its like its only generating what the size of the UIWebView that I set (which is width: 688 & height: 577) If I increase the size of the UIWebView to lets say 900 or 1024 my PDF is empty. My UIWebView is bigger than 577, but in my app, I am able to scroll. Here is method.... -(void)webViewDidFinishLoad:(UIWebView *)webViewPDF { CGRect origframe =

How to detect and handle HTTP error codes in UIWebView?

半城伤御伤魂 提交于 2019-11-30 04:53:14
I want to inform user when HTTP error 404 etc is received. How can I detect that? I've already tried to implement - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error but it is not called when I receive 404 error. You could capture the URLRequest here: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType and hand the request over to the delegate and return no. Then in the received response call from NSURLConnection cancel the connection and if everything is fine (check response) load

How can I scroll programmatically to the bottom in a UIWebView?

余生颓废 提交于 2019-11-30 04:13:13
I know a similar question has been asked before but it seemed never been answered. I have a UIWebView and add some content by string. I use UIWebView because I add some images to it dynamically and also use other HTML features. This example code is simplified. NSString *myHtmlString = @"SOME LONG TEST STRING 1234567890 123456789 0123456789 0123456789 0123456789 01234567890 WWWWWWWWWW WWWWWWWWWW WWWYYYYYYY YYYYYYYYYY YYYYYYYYYY YYYYYYYYYY YYYYYYYYYY YYYYYYYYY YYYYYYYWWW WWWWWWWWWW WWWWWWWWWW WWWXXXXXXX XXXXXXXXXX XXXZZZZZZZ THIS IS THE END I WANT TO SEE"; NSString *myPath = [[NSBundle