FAQ Database Discussion Community


Both iOS WebView types incorrectly setting 320px viewport size on iPhone 6 and 6+ (Xamarin app)

ios,uiwebview,xamarin,viewport,wkwebview
I've been wrestling with this for a few hours now. Here's the repro scenario (Xamarin.iOS 8.10, iOS 8.2): Created a (mostly) empty test web page (no stylesheet, just a width=100% on the body) with the following tag: <meta name="viewport" content="width=device-width, initial-scale=1.0"> Page loaded in both a UIWebView and WKWebView (preferred)...

UIWebView dont bounce and scroll

ios,objective-c,iphone,uiwebview
I m building a very simple ios native app with two view controllers referenced from a tab bar both are webview, one is local html and other is loaded from url for some reason the local webview does not allow scrolling and I cant figure out why. I checked the...

WKWebView Could not create a sandbox extension for '/'

html,ios,objective-c,uiwebview,wkwebview
I would like to use external file .html to use WKWebView. Or is there a solution without external file ? All is working good on simulator, but not on device... Here is my code : NSString *path = [[NSBundle mainBundle] pathForResource:@"myHTML" ofType:@"html"]; NSURL *url = [NSURL fileURLWithPath:path]; NSURLRequest *request =...

Replace inputAccessoryView of keyboard in UIWebView in Swift

ios,swift,uiwebview,keyboard,inputaccessoryview
I've been looking for days for a simple answer but I cannot seem to find it. I want to find and replace the inputAccessoryView of keyboard attached to my UIWebView if the accessory view exists on the keyboard. I want to replace it so I can have my own Prev...

A landscape only subview appears as potrait on iOS 7 works fine on IOS 8

ios,objective-c,ipad,uiwebview,screen-orientation
I am trying to add a subview on a landscape only app in a landscape only mode. This seems to work fine on newer iPads, However when testing this on an iPad 2 the subview only seems to appear in a portrait mode. What could I be doing wrong here?...

UIWebView not save cookies

ios,cookies,uiwebview,save,httpcookie
I use UIWebView that users login in accounts. Users may login with facebook account. He is click button Facebook and opens UIWebView. After login UIWebView close and users may use your personal account. But when I close my app and open it again users not login. UIWebView not save cookies....

Can I change img src in html?

html,ios,css,uiwebview
It's like <img src="somesrc" file="filepath" /> The src is not the correct url, how can I load the img using the url in file attribute for all images? <!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery /jquery-1.4.min.js"></script> </head> <body> <img src="wrongsrc" file="http://www.hi-pda.com/forum/uc_server/data/avatar/000/52/56/39_avatar_middle.jpg"></img> <script > $("img").each(function(){ var filepath =...

UIWebView in a UITableViewCell open link in a browser.

ios,objective-c,uiwebview
I have a ViewController that have a UITableView. UITableViewCell have an UIWebView and I want to open links in a browser. I have set UIWebViewDelegate to my ViewController but method: -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType does not work. How do I open links in a browser? ...

how can i set landscape orientation when playing a video from webview

ios,objective-c,uiwebview,orientation
i have a webview with a video link, the app is only portrait orientation but i need to change orientation when the video is in fullscreen and use all screen. Thanks for your help.

Make a phone call from UIWebView without prompt

ios,objective-c,uiwebview
SCENARIO I have an app that is a UIWebView, I make some url overriding for requirements. PROBLEM To make a call opening url with tel: works weird in iOS7 and iOS8, it makes the phone call direct in the background, but it also ask for the confirmation, so user experience...

dispatch_async UIWebView loadrequest

ios,swift,uiwebview,nstimer,dispatch-async
I'm loading a javascript which is in my App, the script will try to find a solution, which can takes some time. I don't want to wait more than 5 seconds for that solution, in that case I just want to stop the request and show a message to the...

NSArray with UI objects (Performance)

ios,objective-c,performance,uiwebview,nsarray
I have a NSArray (actually is a mutable array) with a UIWebView object in each index. I use this array to populate cell in a UITableView. I use a for loop to initialize each object in the array as following: for (int i = 0; i < [self.events count]; i++)...

uiwebview is shrinking inside a uiscrollview

ios,swift,uiwebview,uiscrollview,xcode6
I want to display HTML content inside on my view. Therefore I am rendering the HTML content using webview. The webview is inside a uiscrollview. Because the HTML changes I need to adjust the height of the webview and the scrollview. I do it this way: func webViewDidFinishLoad(webView: UIWebView) {...

Display multiple views serially using GCD

ios,objective-c,iphone,uiwebview,grand-central-dispatch
I have 4 tabs and all have UIWebView. I want that the first tab should load and displayed immediately without waiting for others to load. For which I did this in UITabBarController class: for(UIViewController * viewController in self.viewControllers){ if(![[NSUserDefaults standardUserDefaults]boolForKey:@"isSessionExpired"]) { if((int)[self.viewControllers indexOfObject:viewController] != 4) { viewController.tabBarItem.tag = (int)[[self viewControllers]...

- (JSValue *)callWithArguments:(NSArray *)arguments crashed in ios7.0.4

ios,uiwebview,javascriptcore
There exist a property @property (nonatomic, strong) JSContext *context; and I set jscontext in webviews's delegate methods. - (void)webViewDidFinishLoad:(UIWebView *)webView { [self.indicatorView stopAnimating]; self.webView.hidden = NO; __weak typeof(self) weakSelf = self; self.context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; self.context[@"closeWebview"] = ^() { weakSelf.dismissViewBlock(); }; } when locationed succeed I will call the method...

Navigation bar not showing on iOS web view

ios,uiwebview,navigation
When a user click the button non my app, it will load another view that contains a web view. However, the navigation is not showing up on the web view. Any suggestion? Here is the code I use to load in the web view: - (IBAction)visiteSite:(id)sender { WebViewController *hospitalSite =...

Objective-C Issues with UIWebView to PDF

ios,objective-c,pdf,uiwebview
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 &...

iOS create pdf from UIWebview content

ios,pdf,uiwebview
In my app for iOS i need to create a pdf document from my webview content. I watched these posts: Creating PDF file from UIWebView and https://coderchrismills.wordpress.com/2011/06/25/making-a-pdf-from-a-uiwebview/ I wonder if there is a simpler way to do it. For example for my project for Mac i use this: NSData *pdf...

Best way to download an external webpage, modify it with js and css, then load it in the view

ios,xcode,swift,uiwebview
Technologies: iOS8, SWIFT, XCode 6 Using swift, what is the best way to save an external website's html/css/js, modify that saved data with my own css / js, and then load it in the view. This way, the external page loads with my custom styles/js already implemented....

UIWebView rendering web pages in a low-quality zoomed in state

ios,swift,uiwebview
Using UIWebView to render Third party websites. I cant use WKWebView for various reasons. There is no Xib/View in storyboard associated with my ViewController. All the UI is loaded in the viewDidLoad() method let navigationBar = UINavigationBar() navigationBar.setTranslatesAutoresizingMaskIntoConstraints(false) navigationBar.barStyle = UIBarStyle.Black //added navigation items self.view.addSubview(navigationBar) UXHelper.createHorizontalConstraints(navigationBar, outerView: self.view, margin: 0)...

Can't get the right value for height of uiwebview

html,ios,swift,uiwebview
I am trying to get the value of uiwebview this way: var webview = self.articleContent println(webview.frame.size.height) // prints 300 // rendering the webview webview.loadHTMLString(articleHtmlContent, baseURL: nil) // getting the height of the webview var output = webview.stringByEvaluatingJavaScriptFromString("document.body.scrollHeight;")! println(output) // prints 300 - again So it looks like the output I...

How to properly write an HTML string on Objective C

html,objective-c,uiwebview
I want to load a specific part of a webpage on a UIWebView [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://jlhs.schoolloop.com/mobile/login"]]]; [_webView loadHTMLString:@"<html><body><div class="slideshow_outer"></div></body></html>" baseURL:nil]; [_webView setNeedsDisplay]; The first is the website address The second is the part of the HTML I want to load and the third is to display it. I get...

Memory warning in webview

ios,objective-c,iphone,ipad,uiwebview
I have the one webview which load the this url https://sketchfab.com/models/9fb581d7cb414e0fbec4108099a73619/embed. After loading this url my web view start showing the memory warning and after some time it crash. I am using the arc in my application Here is my code: (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup...

how do I fake the UIWebViewNavigationTypeLinkClicked for a UIWebVIew

javascript,ios,swift,uiwebview
My problem is the site I'm using in my UIWebView uses Javascript to open a link window.open source, '_blank' //coffeescript Here is my current code I use to catch links... (doesn't work) and in theory, open them in safari. What happens is on click this code DOES in fact fire...

UIWebView Copy Cache Data For Offline View

ios,objective-c,caching,uiwebview
I want to copy cache data into database(sqlite/coreData) so that I can view while offline (without Internet) like " Reading List in Safari ". I read the code at Xcode UIWEBVIEW download , save HTML file and show which is following:- - (void)viewDidLoad { NSURL *url = [NSURL URLWithString:@"http://livedemo00.template-help.com/wt_37587/index.html"]; //[WEBVIEW...

Force UIWebView to load mobile version of website, like Safari does

ios,objective-c,uiwebview
I'm making an app where having a UIWebView is absolutely necessary. However, I'm having a problem where the UIWebView doesn't load the mobile version of the website. I've read some questions on StackOverflow, and they all seem to say it's up to the website to decide what type to display,...

Passing array of dictionary to javascript function from iOS

javascript,ios,uiwebview
My javascript function needs this type of array: var data = [{ "sale": "202", "year": "2000" }, { "sale": "215", "year": "2002" }, { "sale": "179", "year": "2004" }, { "sale": "199", "year": "2006" }, { "sale": "134", "year": "2008" }, { "sale": "176", "year": "2010" }]; I want to...

UIWebView crash on ios 8

ios,objective-c,iphone,uiwebview
When i load a html on UIWebView in ios8 app is crashing. Second time when i open the page again it not crashing , it happens only in IOS 8. On ViewWillAppear calling openLink -(void)openLink{ NSString *pathFile = [[NSBundle mainBundle] pathForResource:filePath ofType:@"html"]; NSURL *url = [NSURL fileURLWithPath:pathFile ]; NSString *urlwithoutQueryString...

iOs Web view how to make static a dynamic page

ios,objective-c,iphone,uiwebview
I have an iOs web View App wich connect to a touch responsive website and I would like to do some tabs in the app, one for contact form, another one for "about us", something like that... The problem is you can navigate to the main web site page from...

Displaying an URL from a different view controller in a UIWebView

ios,objective-c,uitableview,uiwebview
RecipesTableViewController.m #import "RecipesTableViewController.h" #import "RecipeTableViewCell.h" #import "IngredientsViewController.h" #import "Recipe.h" #import "RecipeDetailViewController.h" @interface RecipesTableViewController () { NSMutableArray *recipesArray; } @end @implementation RecipesTableViewController - (void)viewDidLoad { [super viewDidLoad]; //api from recipepuppy NSString *recipeUrlString = [NSString stringWithFormat:@"http://www.recipepuppy.com/api/?i=%@",self.searchRecipe]; //adding percentage on the textfield...

UIWebView shows black screen without data

objective-c,uiwebview,xcode6.1,ios8.1
iOS 8.1, XCode 6.1, Storyboards and 2 UIViewControllers that look like this: The view on the left is the main view, the view on the right is a UIWebView that will show help information written in HTML. My problem is that when I tap on the blue circle with an...

iOS Tumblr Integration using oauth

ios,oauth,uiwebview,tumblr
Trying to understand how this all works. New to oauth and api integrations. Not looking for a better way. Looking to understand and expand on what this is doing. I followed this tutorial and have it working through part 3. I kind of understand, but having a hard time connecting...

Saving images to Main Bundle and then loading them into HTML works on Simulator, but not on real Device?

ios,objective-c,uiwebview,ios-simulator,mainbundle
I'm trying to preload the image tags from an html string in order to load them when the device is offline. Basically, I strip the source url from all the <img>tags, clean the url to have a clean filename, then download the image. __block NSString *imageName = [[NSString alloc]init]; //Get...

UIWebView into a UITableViewCell with dynamic size

ios,objective-c,iphone,uitableview,uiwebview
I have UIWebView objects into multiples UITableViewCell. Each webView has a different size. Originally, all cells are the same height. Once the user touch the cell, it expand to show all webView Content. I'm using - (void) webViewDidFinishLoad:(UIWebView *)aWebView to dynamically get the webView height, and - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath...

Determing which element was clicked

javascript,ios,uiwebview
I have a html like: <div class="clicked-div" onclick="divClicked(this);"> <img src="src1"/> <img src="src2"/> ...... </div> if I set the img onclick event using the following method: var imgs = document.getElementsByTagName("img"); for (var i = 0; i < imgs.length; i++) { imgs[i].onClick=imageClicked(imgs[i]); } function divClicked(div){ alert(div.getAttribute("id")); } function imageClicked(image){ alert(image.getAttribute("src")); } when...

Cookie is undefined after redirect in mobile Safari

php,cookies,uiwebview,mobile-safari
I have a little bit of code that set's a $userid cookie and then redirects as follows: $userid = $_GET['userid']; setcookie('userid',$userid,time() + (864000 * 7), '/'); header("Location: https://coinbase.com/oauth/authorize?response_type=code&client_id=$clientid&redirect_uri=$redirecturi"); This works fine. If I echo $_COOKIE['userid'] after setting it, it displays the userid. So far so good. The redirect is to...

Trying to inject datapoints into iOS webView using highcharts

javascript,ios,swift,highcharts,uiwebview
While porting an android app to iOS we hit a barrier: We have a UIwebView set up to run HighCharts (it works with their provided sample), but we can't figure out how to pass variables to Javascript in order to display real time changes. The android-equivalent of what we're trying...

How do I reload a webview once home button is pressed?

ios,objective-c,uiwebview,ios-web-app
I want to reload my url once I press the home button. I tried the code mentioned in this thread: How to reload a UIWebView on HomeButton press But none of those refreshes/roloads my app once I return to the app from my main screen.Here's the code for it so...

Does iOS support PDF/A?

ios,pdf,uiwebview,qlpreviewcontroller
As the title states does iOS support PDF/A? I tried to open it, but mostly I get a white page with errors like illegal character `/' encountered in hex string. illegal character `/' encountered in hex string. invalid stream length 557; should be 563. FlateDecode: decoding error: invalid distance too...

i am trying to upload html page on web view but images are not loading

ios,uiwebview
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"myfile" ofType:@"html"]; NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil]; NSLog(@"The html string is %@",htmlString); [_Webview loadHTMLString:htmlString baseURL:nil]; ...

Swift: How to put current URL from UIWebView into UITextField?

swift,url,uiwebview,uitextfield
(XCode 6.3.2, Swift 1.2) I simply want to put the URL of the loaded webpage of the UIWebView into an UITextField. The solutions which I found here doesn't work for me. Here's my code: @IBOutlet weak var addressBar: UITextField! @IBOutlet weak var webView: UIWebView! //some more code... func webViewDidFinishLoad(webView :...

UIWebView and touch event

swift,ios5,uiwebview,touch-event
I want use a custom touch event in a view. There is a web view which is the subview of this view. I override touchBegan and other functions but it does not run.

what is the use of UIWebview+AFNetworking class?

ios,uiwebview,afnetworking
I have observed in AFNetworking class 2.5.4 that UIKit+AFNetworking folder has been included.What is the use of various classes used in that folder and How can post request in a webview using UIWebview+AFNetworking class.

UIWebView is working but it doesn't show anything

ios,objective-c,iphone,uiwebview
I'm using UIWebView in my app for lots of things and I've got this bug that I don't know how to solve. The UIWebView didn't show anything at all. I logged all the UIWebView delegates and from what I could tell, it is working just fine. It showed the correct...

iPad App with three different WebViews?

ios,objective-c,ipad,uiwebview
consider the following function: - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSURL *url = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html"]; [self.DC70WebView loadRequest:[NSURLRequest requestWithURL:url]]; } Where as DC70WebView is a property of class UIWebView tagged to a ViewController. My problem is, that I have multiple index.html. First this worked, because there was only one directory....

How to scroll programmatically to a to a line in UIWebView?

javascript,html,ios,objective-c,uiwebview
I want to save the state where the user left the webView (which is loading a local html file) so that the next time when he enters the same view, he is taken to the same line of text that he was reading the previous time. I think that could...

How can I show Google maps into a WebView?

swift,uiwebview,xcode6
When I click the button my app shows a map: it opens the google map perfectly in the browser safari. Now I just want to show the map into a WebView, how can I do it please? Here is the code I use to show the map: @IBAction func newAction(sender:...

Tell when stringByEvaluatingJavaScriptFromString: has completed

javascript,ios,objective-c,uiwebview
I'm using a standard UIWebView and need to know when stringByEvaluatingJavaScriptFromString: has completed. I know a WKWebView has a completion handler, but I need to use the current UIWebView which I was given. Since the method needs to run on the main thread GCD wasn't of much help. Any suggestions?...

Do I use NSAttributedString or UIWebView Swift

ios,swift,uiwebview,uitextview,nsattributedstring
I'm getting different strings that occupy "busDescriptio" depending on what business you choose from a website database. This string contains html tags, images, and links. I was told to use NSAttributedString instead of UIWebView because UIWebView was giving me all sorts of problems such as images in wrong place, text...

Getting return value from JavaScript in UIWebView

javascript,ios,objective-c,swift,uiwebview
I want to fetch JavaScript return value in my ViewController, The problem is that, if there is small amount of data like String, I'm getting it. But if there is large data like JSON object,It's showing nil. When I call same JS function in Safari > Develop > iOS simulator,...

Xcode UIWebView not changing page with changed URL

ios,objective-c,xcode,uiwebview
I'm automatically generating a NSURL based on the distance of a pan gesture on the screen (long story...). Anyways, I'm having no problem generating the URL. The URL dynamically changes, and then I have an NSTimer that repeats every second which tells a UIWebView to reload with the new URL....

Detecting when native select widget is opened/closed in UIWebView

javascript,ios,scroll,uiwebview
When the user clicks on a select box in UIWebView, a native popover is displayed at the bottom of the screen with the available options. The webpage contents scroll up to make room for this popover. It seems like no DOM event is fired when this scroll happens, although the...

Attaching an event to UIWebView ScrollViewer prevents zooming

c#,ios,uiwebview,xamarin
Whenever I attach an event to UIWebView's ScrollViewer to detect scrolling it prevent the UIWebView from zooming in and out. However, scrolling up and down still works. I am viewing a PDF in the UIWebView. I've tried these events: Scrolled ScrolledAnimationEnded ZoomingEnded DidZoom For example I tried: ContractWebView.ScrollView.Scrolled += (object...

Use local resources in WKWebview

uiwebview,nsurlrequest,wkwebview,nsurlprotocol
How do I make WKWebview use local .js, .css and/or local image files, in place of remote files, in order to make the web page load faster. Also, I noticed NSURLProtocol methods (when implemented through register class) do not get called when WKNavigationDelegate methods are implemented, any idea on why?

UIWebView JavaScript Highlight - how to Highlight special characters? (utf8 encoding?)

javascript,ios,objective-c,uiwebview
I was trying to wrap my head around this but I kind of gave up searching. I don't know much about Javascript but I have a .js highlight function for my UIWebView. My problem is that it does not Highlight text if it includes any special characters like: "',à etc."...

How to scale an iFrame inside of iOS UIWebView

javascript,ios,css,uiwebview,scale
The Problem: I've been seeing problems with the native iOS UIWebView with regard to CSS3 transform:scale3D(scalar, scalar, 1) We have an <iframe> which contains pixel-perfect art, consisting of many elements (text, rectangles, videos, etc), and my task is to scale the <iframe> where it fits fullscreen, not just the designed...

WKWebView/UIWebView get website icon

ios,uiwebview,metadata,wkwebview,apple-touch-icon
How can I get the apple-touch-icon or logo of the website using WKWebView or UIWebView? I've read that getting a favicon is possible, however I plan on using the website's logo as a short cut like in iOS Safari and a favicon is too small for it. Is there a...

Save locally generated PDF to app's documents folder in iOS8

pdf,ios8,uiwebview,nsdocumentdirectory,writetofile
It would seem that my apps no longer are able to save files to their documents folder when doing this: NSString *path = [documentsDirectory stringByAppendingPathComponent:fileName]; NSData *dta = [[NSData alloc] init]; dta = [NSData dataWithContentsOfFile:path]; NSLog(@"writing file: %@", path); if ([dta writeToFile:path options:NSAtomicWrite error:nil] == NO) { NSLog(@"writeToFile error"); }else...

UiWebview in IPhone resize as per the content size

ios,objective-c,iphone,uiwebview
I am having an issue like i am using UIWebView in Iphone and data coming as HTML am storing the html data as astring and passing to the UIWebView am getting it in good but i want to Change the UIWebView Size as per the content size - (void)viewDidLoad {...

How clear localStorage for UIWebViews in iOS

ios,swift,cocoa-touch,uiwebview,local-storage
The code that I have now deletes the *.localstorage and backup localStorage files, but the localStorage is still persisted the next time the web-view is opened regardless of the fact that the files are deleted. EDIT: I have to delete the localStorage for ALL domains! I.E. injecting JS won't work....

Calling UIWebView from different class

ios,objective-c,uiwebview
I have ViewController1.m and ViewController2.m In ViewController1.m I have a UIWebView and also I created a method to load a URL. If I call that method from ViewController1.m it works. But when I try to call that method from ViewController2.m I does not work. I realised that it is because...

How to prevent UIWebView scroll to top when I load a new html string?

html,ios,uiwebview,uiscrollview
I have a html string, and I load the html string to UIWebView, and the user may scroll down the UIWebView . When sometime the html string I changed ,so I call the UIWebView load the new html string. But when I load it ,the UIWebView scroll to top.The difference...

How do I enable my back button only when a link is clicked in my UIWebView? (Code won't execute)

ios,hyperlink,uiwebview,back
I'm trying to make it so that the back button will only be enabled when the user presses a link and/or if canGoBack = TRUE. I tried using an if statement in the body but that didn't work. I then tried using what I could find online and it still...

own links in a UIWebview

ios,swift,uiwebview
I try to create own links with own actions in a UIWebView. For that I like to read the value of my own links. I manage to do, but I would like someone would have a review on this, because I am not sure if this is best practice ?...

Fullscreen video in UIWebView interferes with UIViewController's input accessory view

ios,swift,uiwebview,mpmovieplayercontroller
I have a view which I set up as input accessory view for view controller the following way: @IBOutlet private weak var bottomPane: UIView! override func canBecomeFirstResponder() -> Bool { return true } override var inputAccessoryView: UIView { return bottomPane } Everything works just fine until I try to view...

EXC_BAD_ACCESS when performing a segue to ViewController with a UIWebView?

ios,xcode,swift,uiwebview,exc-bad-access
So I have a setup like this: Where I have a custom code reader view controller, and as soon as it detects a barcode, I want it to segue to another view controller with a label and a UIWebView. So far, it works perfectly with just the label being displayed....

'NSURLRequest?' does not have a member named 'URL' - Swift

url,swift,webview,uiwebview
Hi I am really new to coding in Swift, and am trying to follow the codes in this book: http://www.apress.com/9781484202098. Learn iOS 8 App Development 2nd Edition by James Bucanek In particular, I am working through Chapter 3 - building a URL shortening app, but despite having copied the code...

Sencha touch causes iOS keyboard to disappear right after it appears

javascript,ios,uiwebview,sencha-touch-2
We are using sencha touch 2.3.1 Sometimes when clicking on a text field it will bring up the keyboard and then immediately make the keyboard disappear. This is worse on an iPad mini 1, but still sometimes happens on an iPad mini 2. We tried preventing the blur event, but...

Image inside html in UIWebview not fit properly

iphone,ios8,uiwebview,xcode6
I want to show google updates ,webpages are responsive but image width is not showing properly and go out of the boundary. Here is content of webpage. <div dir="ltr" style="text-align: left;" trbidi="on"><span id="docs-internal-guid-489c1670-b0dc-d32d-645e-eaf6ca555069"><span style="font-family: Verdana; font-size: 13.3333333333333px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;"><img alt="whats_new_doc_header_may2015LL.gif" height="112px;"...

How to change UIWebView keyboard toolBar in iOS 7?

ios,objective-c,iphone,uiwebview,uikeyboard
UIWebviewkeyboard contains next,previous buttons like (<,>). I need to add a custom toolBar forUIWebView KeyBoard toolbar. Please advise me. I customised in iOS 8 but it is not working for iOS 7. - (void) addCustomToolBarForWebViewKeyBoardToolBar { UIWindow *keyboardWindow = nil; for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) { if (![[testWindow...

Memory leak with UIWebView

memory,uiwebview,dealloc
My project is a hybrid static lib for showing a UIWebView with some JS to control the logic. When I use 64bit and run demo on iOS 8/iPhone 6, the memory keeps going to 30M or more! When I use generation in instrument, the increased memory usage is almost all...

How can I integrate ASP pages and queries into an iOS app?

ios,asp-classic,uiwebview
I have a rather puzzling scenario right now, of figuring out how to integrate several large queries (many different items for each) into an iOS app that communicates with a C#-based REST API. I am trying to pull up several reports in the app, and if I recreate all these...

Get current URL in UIWebview but it not respond

ios,objective-c,cocoa-touch,uiwebview
I create app to use UIWebview and show log to url if touch in content in UIWebview. this is my code - (void)viewDidLoad { [super viewDidLoad]; NSURL *url1 =[NSURL URLWithString:@"MyWebSite"]; NSURLRequest *request1 = [NSURLRequest requestWithURL:url1]; [_webView1 loadRequest:request1]; NSURL *url2 =[NSURL URLWithString:@"MyWebsite2"]; NSURLRequest *request2 = [NSURLRequest requestWithURL:url2]; [_webView2 loadRequest:request2];//url menu 2...

Create dynamic checkbox in UIWebView

javascript,html,ios,objective-c,uiwebview
I am trying to create dynamic checkbox in UIWebView. I am using this code : NSMutableArray *array = [[NSMutableArray alloc]initWithObjects:@"Sudhaadagdudgdada",@"qwertyuiopo",@"asdfghjkl", nil]; for (int j = 0; j < array.count; j++) { NSString *html = [NSString stringWithFormat:@"<div id='check'></div><script> str=''; str += '<input type=\"checkbox\" name=\"one_'+i+'\" value=\"'+%@+'\" onclick=alert(this.value); />' document.getElementById(\"check\").innerHTML=str;</script>",[array objectAtIndex:j]];...

NSURL/NSURLRequest is unexpectedly nil

ios,swift,uiwebview,nsurl,nsurlrequest
I'm trying to load a PDF into a UIWebView, but when using loadRequest, I'm getting the error unexpectedly found nil while unwrapping an Optional. My relevant code is below: let url = NSURL(string: "http://www.urartuuniversity.com/content_images/pdf-sample.pdf")! println(url.fileURL) println("The URL is \(url.absoluteURL!)") let request = NSURLRequest(URL: url) webView.loadRequest(request) The second line of code...

What causes some iOS web pages to not continue scrolling when swiping finger is released?

css,scroll,uiwebview,mobile-safari,hybrid-mobile-app
I have webpages or certain scroll context sections of webpages that do not scroll correctly in mobile Safari and UIWebView. When you are swiping, the normal behavior is for the page to continue scrolling after your finger leaves the screen, and gradually stop depending on how quickly you swiped. On...

iOS uiwebview magnifying glass keydown event

javascript,html,ios,uiwebview
I have a UIWebview for text editor. And I want to know font status in cursor location. So I had onkeyup event on div like this <div id='content' overflow-y='no' contenteditable='true' onKeyDown='callObjFunction()' onkeyup='callKeyUpFunction()' > </div> and got callback on moving the content cursor with keyboard, But I can't get call on...

Immediately editing a editable UIWebView

ios,objective-c,swift,uiwebview
I'm using the standard mechanism for enabling an editable UIWebView (the contenteditable attribute in the div tag). Everything is great - when I load my view, the UIWebView loads, and when I click, I go into edit mode. However, what I want to do is that when my view loads,...

UIWebView Screen Fitting Issue

ios,objective-c,iphone,twitter-bootstrap,uiwebview
I have developed a website in Twitter Bootstrap, I am now using a UIWebView to display that site inside of an IOS app. I am getting it to display fine, but the screen is off and it is running off of the side of the screen... I feel like I...

Xcode Master Detail Application UIWebView not loading content

ios,xcode,uiwebview,uisplitviewcontroller
I have a Master Detail Application, on the RootViewController(master) I'm using a tableview to display links, when a user clicks on one of the cells it should populate the detailview with the appropriate webpage. In the RootViewController here is the code I'm using on the DidSelectRow: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath...

Put Swipe Gesture over UIWebView to Get Scroll Direction in IOS

ios,xcode,scroll,uiwebview,swipe
I want to get the scroll direction in webView. I read the code about getting scroll direction here. -(void)userDidScrollWebView:(id)scrollPoint{ // NSLog(@"scrolled:::"); NSString *x1 = [webView stringByEvaluatingJavaScriptFromString: @"scrollX"]; NSString *y1 = [webView stringByEvaluatingJavaScriptFromString: @"scrollY"]; NSLog(@"scroll x=%@ y=%@", x1,y1); if ([y1 isEqualToString: @"0"]) { NSLog(@"RELAOD ME"); } } I have 2 Questions...

iOS WebView blank gap

ios,swift,uiwebview
I have embedded a Youtube video in my iOS 8.3 app using youtube's standard embed url (sample) which is working as expected but looking pretty weird. That white gap (blue zone on the view tree inspector) should not be there. I can confirm it's not a CSS issue as the...

UIWebView simulate mouse position

javascript,ios,html5,uiwebview
Is it possible to programmatically (using stringByExecutingJavascript most likely) set the mouse position (x,y) "perceived" by HTML-5 elements on a UIWebView so that it would trigger hover, mouse over, etc...

UIWebView first request too slow

ios,iphone,uiwebview,uiwebviewdelegate
I am using UIWebView to render web content in my application. I observed that the initial request when the app launches i.e. loadRequest, takes a long time to render the contents. However the subsequent requests which I don't track of, are much faster. To confirm this, I created a standalone...

QLPreviewController and UIWebView do not display filled PDFs

c#,ios,pdf,uiwebview,xamarin
I have a PDFthat has text boxes in it. My program uses Xfinium PDF software to fill the text boxes. When I view the filled in PDF the document shows up with no data in the fields. I have tried using QLPreviewController and UIWebView and they both do not display...

Launching app post authentication in browser

ios,objective-c,authentication,uiwebview
So I launch a browser(UIWebView) in my iOS app for authentication. User types username and password and the request for authentication is posted to a Identity Provider server. It sends the response back in same browser window. Now after successful authentication I want to show first screen of the app....

UIWebView not full screen on rotate

cocoa-touch,ios8,uiwebview
(This looks like a question that has been asked/answered 100 times but I can't get it to work.) I have a view controller that is story board based. Nested in the main view is a webUIView. In the controller method viewDidLoad I am simply specifying the URL and setting the...

Sending Control Commands to UIWebView for Online Game - Swift

ios,swift,uiwebview,xcode6
I am trying to port a basic game to iOS that is only playable on the web. However, the web version is unplayable for iDevices because of the lack of proper keyboard controls, despite the fact that it runs perfectly speed wise. Is there any way to emulate a keyboard...

Add path to remote server in iOS app

ios,uiwebview,nsuserdefaults
I try to open a specific path in my app, but nothing is displayed in the UIWebView in my simulator, my orignal code is : - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. NSString *host = [[NSUserDefaults standardUserDefaults] valueForKey:@"host"]; NSString* complement = @"/manager/"; NSString...

MEDIA_ERR_DECODE on HTML5 video in iOS UIWebView after many plays

ios,objective-c,html5,video,uiwebview
After playing around 20 short video clips (mp4's) in an HTML5 video control in a UIWebView in iOS, subsequent clips are failing with a MEDIA_ERR_DECODE. The thing is, is that I know the videos are fine, because they were previously played, sometimes even during the same session. Furthermore, if you...

How to open a website on UIWebview as computer?

uiwebview,safari
On Google Chrome there is this option "Website for computer". Many websites recognize that your are using mobile phone and they redirect you to another website made for mobiles. I just need to don't let them to recognize that I'm using a UIWebview from IOS....

If condition, load table view else load web view xcode

ios,objective-c,uitableview,uiwebview
I have a View Controller. Within this view controller I have a menu and a tab bar depending on what menu item is clicked. Depending on what is clicked in the menu/the tab bar. I want to load either a UIWebView or a UITableView with data. I have already added...

How to call https url in uiwebview (swift)?

swift,ssl,https,uiwebview
I have https url with self-sign certication in UIWEBView ,but it does not work. Error is NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)... how can I to allow any certication in uiwebview by swift Do you have any idea that fix this problem?...

Expanding & Contracting adjacent UI objects within a view

ios,uitableview,uiwebview
I have a ViewController that is divided in 2 parts. The top is a UIWebView The bottom is a UITableView Sometimes, there is no content required for the UITableView. So what I would like to do is have the UIWebView expand into the empty space the UITableView has relinquished. I...

UIWebView get http status code from loaded page

ios,uiwebview,nsurlrequest
I using a UIWebView in a game to display a customer support form. I noticed i have problem to close the webview if the server return a 503 error (http status code sent from a load balancer) Is there a way to easily get this http status ? can I...

Implementing UIWebView inside UIScrollView

ios,iphone,uiwebview,uiscrollview,uikit
I'm trying to use UIWebView inside UIScrollView, I want to display an webview under an image and make them scrollable. So I flowed those step : Desactivate the Scroll Property for UIWebView Set the UIScrollView and UIWebView height equals to content size. And this my code : - (void)viewDidLoad {...

Would a file with a response header `Cache-Control:Private` be prevented from being cached in a NSURLCache?

ios,caching,uiwebview,nsurlcache
Would a file with a response header Cache-Control:Private be prevented from being cached in a NSURLCache? Either a shared cache (as in setSharedCache and NSURLCache.sharedCache() ) or a custom one? To expand, I have UIWebView that I need to access when offline. The source of this WebView has multiple external...

How to open cyrillic domain in UIWebView?

ios,objective-c,iphone,uiwebview
I try to open cyrillic url in UIWebView, but it's can open. I use the following code% urlString = [NSString stringWithFormat:@"http://%@", urlString]; urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; url = [NSURL URLWithString:urlString]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [_webView loadRequest:request]; If i try to open https://www.google.ru/webhp?q=президент#newwindow=1&q=президент everything is OK, but when I try...

Convert a Base64 NSString to UIImage? [duplicate]

ios,uiwebview,uiimage
This question already has an answer here: Create a UIImage from string data 1 answer The NSString is got from UIWebView used the following javascript method: function() { var img=document.getElementById("myimg"); var canvas = document.createElement("canvas"); var context = canvas.getContext("2d"); canvas.width = img.width; canvas.height = img.height; context.drawImage(img,0,0,img.width,img.height); return canvas.toDataURL("image/png"); } I...

Go to where word is highlighted

javascript,ios,uiwebview
I have my app registering a highlighted word when I search in a html file through a UIWebview. The issue I have is the program is just highlighting the selected words. Since I have several pages, how do I make it so the program will automatically go to where the...