uiwebview

Grey bar on top of UIWebView in iOS 10

亡梦爱人 提交于 2019-12-23 04:12:40
问题 When I drag a UIWebView from the Object Library in Xcode, I get a UIWebView with this dark grey bar at the top: What is that and how can I get rid of it? 回答1: You need put self.automaticallyAdjustsScrollViewInsets = NO; in ViewDidLoad The other choice is disable option Adjust Scroll View Insets in the .xib of your viewcontroller 回答2: That dark grey color is the background color set for the UIWebView. This will show if a webpage is smaller than the frame of the web view. You won't see it if

Jump through search results in UIWebView with Javascript

孤街醉人 提交于 2019-12-23 04:02:29
问题 I have set up a search in uiwebview with javascript that works great, but I want to be able to jump to the next found word in the search results. I have succeeded in geting the view to scroll to the first instance by using this code: if (uiWebview_SearchResultCount == 1) { var desiredHeight = span.offsetTop - 140; window.scrollTo(0,desiredHeight); } How can I get this searchresultcount to update to the next found result(say 2, 3, 4, 5, ect...) when user presses button in app?? Thanks in

Xamarin iOS clear cache from WKWebView

懵懂的女人 提交于 2019-12-23 03:54:10
问题 I am doing following to clear the cache from the WkWebView . I would like to know how do I confirm that the cache is cleared var request = new NSUrlRequest (webURL, NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 0); NSUrlCache.SharedCache.RemoveAllCachedResponses (); NSUrlCache.SharedCache.MemoryCapacity = 0; NSUrlCache.SharedCache.DiskCapacity = 0; Is there a way to print the cache when making the request 回答1: From this question looks like you do this (c# version) for iOS 9

UIWebView Content Offset

旧街凉风 提交于 2019-12-23 03:53:06
问题 I want to show a google.maps url into a UIWebView in my app but the page comes up in different point from this that i want. I tried everything of many questions here such as set contentOffset of webview.scrollview or contentInset or scrollsToTop or even with javascript commands but neither of them works.So this is the problem: and this is the expected result that i would like to have: I want my webpage to come up on top and not in the middle. url : url 回答1: This has nothing to do with content

UIWebView and CSS fixed position

眉间皱痕 提交于 2019-12-23 03:09:11
问题 I have a UIWebView that uses a fixed position header. When the ViewController that contains the UIWebView is the initial view, there is no problem with the fixed position divs. When I display that same ViewController through a Modal segue, that's when the problem occurs. The first time I scroll on the page, the divs move and scroll with the page, but once I let go of scrolling for the first time, the div returns to its fixed position and the error never happens again. Any ideas? I've seen

UIWebView doesn't seem to be loading the page

≡放荡痞女 提交于 2019-12-23 02:51:18
问题 I've got a navigation controller based app that downloads an RSS feed and lays out the item titles in a TableView. That part works. When I click on an article title, I want to push an instance of my FeedArticleController onto the navigation stack. The FeedArticleController loadView method sets up the views (since I want to learn how to do this programmatically instead of using IB). Here's the loadView: - (void)loadView { UIView *view = [[UIView alloc] init]; self.view = view; webView = [

Use UIWebViewNavigationTypeLinkClicked Filter

ε祈祈猫儿з 提交于 2019-12-23 02:38:53
问题 I want to store the clicked URL by UIWebViewNavigationTypeLinkClicked. However I just want to store the clicked URL not a series of URLs after clicking in some URLs with ads. Anyway to deal with this? 回答1: When you clicked inside webview below delegate will called you need to implement below delegate method then on the basis of this you can check that url and store in an array accordingly- - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:

Maintaining session in after closing UIWebView

别等时光非礼了梦想. 提交于 2019-12-23 00:52:32
问题 I have an application which has a login page resides on the application server. So I open a UIWebView to handle the login. After then I want to switch to the UIView and make API calls using ASIHttp library (others may also be acceptable). The problem is; after I login server keeps session object for authentication purpose, so when I close the UIWebView and switch to a UIView and make an API call, it fails. I believe, somehow I need to maintain session object (set after login) in the API calls

Modify URL Before Loading Request in UIWebView

我是研究僧i 提交于 2019-12-22 19:49:52
问题 I created a native app from my web app using UIWebView . My webapp is a basic CMS with some static pages, some category pages and and some detail pages. Now I need to check if the request comes from the web app or the native app. To do this I have two possibilities: First solution: Modify URL and check URL on server side: @IBOutlet var WebView: UIWebView! override func viewDidLoad() { super.viewDidLoad() loadWebPage() } func loadWebPage() { let url = NSURL(string: "http://localhost:8888

How can I open a WebArchive in a UIWebView?

安稳与你 提交于 2019-12-22 18:36:46
问题 I'm trying to open a Webarchive stored in a Core Data database. The Core Database was created on a Mac and filled with some Webarchive by using a WebView. Now I want to display these WebArchives in the UIWebView in iOS. The problem is that I don't know how to do that. In a similar post to this (here) Digital Robot said, that Webarchives are supported on iOS and I only have to load it from disk with a simple NSURLRequest into the UIWebView. The problem here is, that it doesn't get loaded - I