uiwebview

iPhone - Make a UIWebView subview scrolling to top when user touches the status bar (iOS 4)

☆樱花仙子☆ 提交于 2019-12-04 17:41:04
I have a mainView that contains : a paginated scrollView, a page Control a close button and each page of the scrollView contains a subview that contains a webView. The user can go left to right from pages to pages, and scroll up and down each webView. But... how can I make the currently displayed webView scroll to top when the user touches the status bar ? EDIT : for iOS4 of course. [yourPaginatedScrollView setScrollsToTop:NO]; [(UIScrollView *)[yourWebView.subviews objectAtIndex:0] setScrollsToTop:YES]; The first line is important too else two scrollviews will be assigned => iOS can't really

Using UIActivityIndicatorView with UIWebView in Swift

心已入冬 提交于 2019-12-04 17:37:33
问题 I'm trying to display an Activity Indicator View in my app to users while a url is being loaded into a WebView. I've tried toying with activity.startAnimating/activity.stopAnimating and tried placing them in functions, etc. but have not had any luck. The best I have been able to get is the Activity Indicator to appear and animate, but then not stop animating or hide once my url is loaded, so it continues spinning on top of the web page. In other situations, when trying to move around activity

Memory leak UIWebView when loading from file instead of URL?

流过昼夜 提交于 2019-12-04 17:26:04
I have a UIViewController that contains a UIWebView (OS 3.0). If I load it with file data, as soon as the 'Back Button' is hit and the view is dismissed, I'm seeing EXEC_BAD_ACCESS error with WebCore object releasing 'SharedBuffer' - (void)viewDidLoad { NSString *htmlFile = [[NSBundle mainBundle] pathForResource:fileName ofType:@"html"]; NSData *fileHtmlData = [NSData dataWithContentsOfFile:htmlFile]; [webView loadData:fileHtmlData MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@""]]; } If I change the above to load via request, everything is fine. NSURLRequest

Setting UIScreen's mode / resolution

十年热恋 提交于 2019-12-04 17:24:35
I have to set the external UIScreen's mode to run with the resolution 1024x768. First I search if the screen supports this resolution: if ([[UIScreen screens] count] > 1){ CGSize size1024; size1024.height = 0; size1024.width = 0; UIScreenMode *screenMode1024 = nil; UIScreen *secondScreen = [[UIScreen screens] objectAtIndex:1]; for(int i = 0; i < [[secondScreen availableModes] count]; i++) { UIScreenMode *current = [[[[UIScreen screens] objectAtIndex:1] availableModes] objectAtIndex: i]; if (current.size.width == 1024.0 && current.size.height == 768.0) { size1024 = current.size; screenMode1024

custom buttons on uiwebview(iphone)

社会主义新天地 提交于 2019-12-04 17:18:28
I want to add custom button on webView. they should also should be there when i try anything in url. how is it possible?? basically i want to put buttons on uiwebView and they are custom buttons //edited code... I am doing this...here link is appearing but method is not getting called...and there wasnot any error in your code ..:) NSString *imagePath = [[NSBundle mainBundle] resourcePath]; imagePath = [imagePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"]; imagePath = [imagePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; NSString *HTMLData = @"<html<a href=\

Why does UIWebView shrink images?

回眸只為那壹抹淺笑 提交于 2019-12-04 17:10:23
I'm using a UIWebView to display images in base64 ( http://www.abluestar.com/utilities/encode_base64/index.php ). The UIWebView is set to "Scales Page To Fit" and Mode is "Left". The image might be 400px wide but once rendered in the UiWebView, it takes up not even half of the screen. I need to do something like style="width:800px;..." before it begins to take up most of the screen and is readable (because it isn't so small). Is this the right way? Why does the image shrink in the UIWebView and I have to then stretch it? The best way I've found to counter this is to use this meta tag in my

epub reader to handle big html file

柔情痞子 提交于 2019-12-04 17:07:55
I am creating an epub reader on IOS platform. Basically, it uses UIWebview to display epub files, I read the code of open source Aepubreader and find it's very good but not text based. I want to make it text based and page turn like iBooks. So I try to refine the Aepubreader The basic logic flow is unzip the epub file. parse the meta data(opf,toc file). load html files by UIWebView and bind it to UIPageViewController Everything works good except the performance. Supposing the epub has ten html files(file1 - file10). file1 ~ file9 is small size(like 100k), but file 10 is 1MB. when I read to the

understanding XMLHttpRequest responses using this (or other javascript) functions?

◇◆丶佛笑我妖孽 提交于 2019-12-04 17:02:34
Is there anyway of getting iphone/iPad to access XMLHTTPRequests, i.e. ajax responses from a web page within UIWebView. I've tried a couple of solutions out there where the response url is changed so that the app can identify that it is indeed an ajax response. I'm new to ajax but I'm keen to learn. I just wandered if anyone could tell me the correlation between responses from ajax and the receiving browser. Getting it to work through the iOS's uiwebview would be an added bonus. So far I'm trying ajax_handler.js var s_ajaxListener = new Object(); s_ajaxListener.tempOpen = XMLHttpRequest

Load Content in the UIWebView on the Iphone

前提是你 提交于 2019-12-04 16:59:34
I would like to show Content in the UIWebView, which I have added to the Project. (for example an image) I know how to set a text in the UIWebView, but I would like to add images or a video which I have added to the project. Ok, I am assuming you are using loadHTMLString to set the HTML on your UIWebView . So to reference images that are stored in your App bundle, you just need to get the right path to put in your img tag. So get the path string: NSString * imgPath = [[NSBundle mainBundle] pathForResource:nameOfImage ofType:@"jpg"]; Format some HTML with an image tag: NSString * html =

iOS WKWebView detect when reaches bottom

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 16:47:50
I have a migration issue from UIViewView to WKWebView, detecting the Scroll View reached bottom when using WKWebView. Prior to WKWebView I used the UIScrollViewDelegate detecting wether the User had seen all of the content by scrolling till the end of the WebView. If he did, the "confirm" button was enabled. iPhone - knowing if a UIScrollView reached the top or bottom Now with WKWebView this doesn't work anymore. I guess the reason is, when using a WKWebView and load a html string, it scales the view down for full visiblity of the content. So I had to set the viewport by appending it to the