uiwebview

iOS UIWebView crash in “WebThread”

瘦欲@ 提交于 2019-11-29 02:12:28
Anyone able to help me out with this crash? It happens intermittently when switching back and forth between some UIWebView instances while they are loading. The crash is often slightly different, but it's always a crash of the "WebThread" with a similar stack trace. Here's the relevant parts of two crashes: Date/Time: 2011-11-08 14:29:01.165 -0500 OS Version: iPhone OS 5.0 (9A334) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000006 Crashed Thread: 4 Thread 4 name: WebThread Thread 4 Crashed: 0 ??? 0x00000006 0 + 6 1 WebCore

UIWebView and JavaScriptInterface in Swift

拜拜、爱过 提交于 2019-11-29 02:10:21
How can I to create the JavascriptInterface channel from my web site to my UIWebView? Example in Android: webView.addJavascriptInterface(new WebAppInterface(this), "Android"); And from this JavascriptInterface I would like to draw the methods, as for example: func webViewDidStartLoad(webView: UIWebView) or myActivityIndicator.startAnimating() How can I do? Phocs For WKWebView: source here JavaScript function callNativeApp () { try { webkit.messageHandlers.callbackHandler.postMessage("Hello from JavaScript"); } catch(err) { console.log('The native context does not exist yet'); } } Swift import

uiwebview not resizing after changing orientation to landscape

℡╲_俬逩灬. 提交于 2019-11-29 02:08:07
I'm coding an iPhone app in which I have a UIWebView that loads a website with a responsive design. The problem I have is when I rotate the devices to landscape: the UIWebView rotates but it keeps the same width as the portrait mode. I spent the last 5 hours searching all over the net, I found some solutions that I used but without success... in my html page i'm using <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> i tried using <meta name="viewport" content="width=device-width" /> nothing changed, in my code I'm implementing the

Matching subview's width to it's superview using autolayout

99封情书 提交于 2019-11-29 02:04:57
Goal: Have a UIWebView be the same width as it's superview, which is a UIScrollView , using autolayout constraints. Code NSLayoutConstraint *makeWidthTheSameAsScrollView =[NSLayoutConstraint constraintWithItem:self.questionWebView attribute:NSLayoutAttributeWidth relatedBy:0 toItem:self.masterScrollView attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0]; [self.view addConstraint:makeWidthTheSameAsScrollView]; NSLog(@"The width of questionWebView *AFTER* adding the constrain is: %f", self.questionWebView.frame.size.width); NSLog(@"The width of scrollView *AFTER* adding the constrain is

YouTube embeds in UIWebViews no longer working in iOS

ε祈祈猫儿з 提交于 2019-11-29 01:35:53
问题 I've had an app out for a while which uses UIWebView s to display YouTube videos on certain views. Today, without any changes to the code, my users started complaining about the YouTube embeds not working: the embed with the still frame and play button displays fine, but upon clicking the play button the embed screen just goes black and nothing loads, no sound or video. Here is my function for generating an embed code to put into the UIWebView from a YouTube ID: + (NSString*)codeForYouTubeID:

Reliably opening App Store links from a UIWebView

有些话、适合烂在心里 提交于 2019-11-29 01:26:18
I have an app that will display web pages within a UIWebView. The pages it shows may contain links to other iPhone apps on the App Store. In a normal browser on a desktop computer, clicking these App Store links would take me through a number of URL redirects and eventually end up opening iTunes and taking me to the page for that App. Is there a way to ensure that when an App Store link is clicked inside my UIWebView that the App Store app on the iPhone will open and show the app? What I've been seeing in my tests is that there are several types of links that can result in an App Store page,

Creating a good custom emoticon chat experience on iOS

南楼画角 提交于 2019-11-29 01:21:13
问题 I'm trying to come up with possible implementations for what is basically an expanding UITextView with the capability of typing inline images. There are literally dozens of open source projects I've seen that handle creation of labels with custom emoticons, UIWebViews that draw your images inline with text and so on, but none that don't run over the native UITextView behavior: Autocorrect Spelling Magnifying glass Selection tooltip and capability Double space for period The only app I've seen

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

我怕爱的太早我们不能终老 提交于 2019-11-29 01:01:38
问题 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

Disable Twitter Universal Deep Links

痞子三分冷 提交于 2019-11-29 00:46:45
问题 Update: It appears Twitter has fixed this issue. Clicking the authorize button now works! Thank you all for the responses. I have a UIWebView that opens and directs to Twitters Oauth/Authorize webpage. The user signs in with there Twitter details and authenticates the use of our application with there Twitter account. This process worked perfect before the release of Twitter 6.37 iOS application. What happens now is when the WebView detects https://twitter.com/oauth/authorize?oauth_token

Turn a page (a UIWebView) with an animation

让人想犯罪 __ 提交于 2019-11-29 00:44:07
I have a webview, which shows the pages of a ebook. I want to switch from one page to the next page with a page curl animation. By now, I know how to switch the page and how to apply a page curl animation on the webview. But how do I apply the curl animation in a way that it looks like flipping from one page to another? Here's some downloadable code with an example of how to do this. I think you required to use "WebKit CSS animation" for getting animation in UIWebView. Read DashCode_UserGuide.pdf (its available on Apple 's Dev Center Resources) 来源: https://stackoverflow.com/questions/2598307