How can I load a specific part of webpage in UIWebView ?? - ios

I need to load or hide a part of a web page that can be viewed in my WebView.

Take a look at these two StackOverflow questions - between them, you should be able to solve your problem.
First:
Objective C - UIWebview to load only a certain part of the webpage?
Then, take a look at:
Reading HTML content from a UIWebView

Related

pdf file not showing all the pages in uiwebview in ios using objective c

Pdf file not showing all the pages in iPad apps out of 5 page it is showing only 3 when scrolling up. Remaining 2 page not showing but it showing empty screen. After using zoom or un-zoom using pinch all the pages we can able to view.
I don't know why at first time not loading all the 5 page.
I have used UIWebview to read the pdf file.
First of all, UIWebView is deprecated. It is better to update your app to use WKWebView instead and try again. You can also use below method to load from the fileURL using WKWebView
- loadFileURL:allowingReadAccessToURL:
Hope this will help.

How to customize a website content to present in a scroll view?

I have a perfect example for what i'm trying to do:
There is a new app called watchville, its an app for watch lovers, and they present rss from several websites in a nice customized way.
This is the page without customization :
This is the page after you click on the button for the customized view :
I did the cover image and all, but I want to customize the actual content...header, body etc and make it look elegant like here..
This is what i did:
Can someone help?
Tnxxx
Try using paginated web page and you can cache data for pages using NSURLProtocol.
It would load pages and cache onto disk so navigation backward would be from cached and only 1 page would be in memory which is being viewed.
That is best you can do with UIWebView OR you may go for MKWebView it can allow you additional features like javascript.

How to indicate a webpage loading progress in a UIWebView? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to use UIProgressView while loading of a UIWebView?
In my app i have a UIViewController with a UIWebView and a toolbar as a subviews.
The toolbar has a UITextField for the address. When loading a page the address field should indicate the loading progress of the webpage something like Safari's address bar or Facebook app for iOS when loading an external link.
The problem that i face is that i can't find a way to show the progress of the page when loading, making the address field(UIText field) fill with a color.
Is there any way to do that or a component already made for this?
To my knowledge there is no way that you could read the progress of a HTML page being loaded into an UIWebView. However I have an idea what you could do. It is a bit "around the corner" but if displaying a progress bar while loading a HTML page into a UIWebView is REALLY important to you, here is what you could do:
Do not load the HTML directly into the UIWebView. Load it into memory first (you can use the ASIHTTPRequest library to do that really easily).
ASIHTTPRequest offers a delegate method that allows you to access the progress of the request. Use that to display the progress.
Once the HTML finished loading, render it into the UIWebView using [UIWebView loadHTMLString:]
As I mentioned before this is really unconventional, but if you really need the progress to be displayed it is the only way I can think of.

Loading page into cache without using UIWebview

I want to load few local html pages into UIWebview, but UIWebview is sometimes taking 2-3 seconds to load these pages the first time. I wanted to know how can I load couple of those pages at a time into memory prior to displaying through UIWebview? Is that possible?
Thanks for your help.
You could have a UIWebView in the same XIB as a normal view and hide it behind the normal view. Then, when the user needs to see the UIWebView, use this code:
[self.view bringSubviewToFront:webView];
I don't know if this is the best method, but it'll work. Now the UIWebView is actually open and actively loading a web page and the user doesn't even know.

UIWebview in iPad

1) I load a URL in UIWebview ,which has some images .I want to enable the option,"save photo" which appears when you long-press the images in webview.Currently this option is available in Safari Browser.But I couldn't find any option in UIwebView class, And UIdataDetectorType struct dont have option for images (as of my knowledge.)
So how do I have this in my APP?
2) when I open some PDFs in webview ,I want to provide an option to open the pdf in iBooks.
How to do?
Thanks in advance.
GopiKrishnAn
I think this should be 2 separate questions.
1/ Read this blog post by iCab's author: Customize the contextual menu of UIWebView. It shows you exactly how to implement long press detection in a UIWebView.
As a bonus, his blog is a wealth of useful information about UIWebView.
2/ You need to work with UIDocumentInteractionController. As its initialization method (+ (UIDocumentInteractionController *)interactionControllerWithURL:(NSURL *)url) only works with a local URL, I guess you need to download the PDF and save it somewhere before you are able to provide such options.

Resources