I've got an UITextView in my app where rss feeds are loaded in. Now I want that when there's a link in the textview and you tab on it, my webview should open that link not safari. How can I do this?
Hey,
It will be difficult for you to know where you have clicked in your UITextView.
Honestly the best way for you to do that it to use the Three20 framework.
I don't think this is possible in a UITextView without significant effort.
Just an idea, but could you not load your RSS feed directly into a UIWebView? - (You can display a HTML formatted string in a UIWebView). Subsequent link presses could then by hijacked using the UIWebView delegate and handled by your application to (for example) open them in another UIWebView. Take a look at the UIWebView interface & delegate to see if it might help.
Hope this helps!
Nick.
Related
OK, I'm doing some experiments with WebView-based native OSX apps, and I'm wondering:
Which are the necessary steps in order to fully camouflage it? (So, that the user - ok, a non-technical user, actually) cannot possibly understand it's a webview.
How can we eliminate the right-click menu (including the "Reload" item)?
Last but not least:
If the actual webpage content is loaded on startup (in awakeFromNib), even for a simple webpage, it takes 1-or-2 seconds before the actual content shows up. During this time, a white/empty background shows where the webview/page should be. What could I do about that? Perhaps a "loading" indicator?
Any help will be appreciated! :-)
To eliminate the right click menu implement the webView(_:contextMenuItemsForElement:defaultMenuItems:) method of WebUIDelegate protocol.
In my app I have a webview that is used solely for displaying the facebook page.
However, the client does not want the top blue bar of facebook to appear; he wants to hide it.
Is there a way to do this?
The bar is 45 pixels, so what I did is I moved the UIWebView in IB in such a way that its top 45 pixels are behind my navigation bar (thus not appearing).
However, this is not an ideal solution, as the user can see that content when he scrolls up, before bouncing. He can see but not touch it, which will be frustrating for some users.
I tried turning the bouncing off, but then the UI becomes too rigid, and not fluid.
I looked up in Google and Stackoverflow for a couple of hours but didn`t find a solution.
Thanks a lot!
You'll have to edit the HTML/CSS of the page itself to hide the HTML elements in question, probably using regular expressions, and feed it into your UIWebView with loadHTMLString:baseURL:.
I've done similar manipulating before and it works, but... it's a different ballgame when the webpages in question don't belong to you. Any time Facebook updates their layout, your app behavior might change until you have time to get an app update approved. Clients want what they want, but make sure your client knows what he's asking for!
First test out the javascript code used to hide whatever elements in the webpage and then pass up to stringByEvaluatingJavaScriptFromString of UIWebView to run it.
I want to open multiple pages in my app just like iPhone( safari browser). Have two questions:
What is the best way to hold the views here, One view controller with an array of views to switch from ?
how to show safari like selection of views,where we can slide through a row or views and select one.
If you have any links or examples for this functionality pls share.
Thanks in advance.
There is a open source library that implement something that look like the mobile safari (iPhone) multiple page selection. It is not using some uiwebview in the sample, but I guess it can be adapted to use uiwebview : https://github.com/100grams/HGPageScrollView
I'm also working on a Mobile safari clone, it's not yet implementing multiple pages selection, but I plan to add this when I'll be able to find some time to work on this. You can check this project here : https://github.com/sylverb/CIALBrowser
look for uiscrollview uiwebview
My UIWebView has a huge data to display and the default scrollbar that comes with UIWebview takes lot of time to scroll.
Is it possible to implement a scrollbar on which user can tap and drag that were he wants.
Any hint in the right direction would be highly appreciated.
Waiting for your reply.
Thanks in advance
It depends on the type of the contents you are displaying in UIWebview.
Did you try make use of Javascript calls to scroll to certain ids within your html page?
Take a look at the wikipedia application or Wikipanion for iPhone for example... They have navigation screen so the user can jump to the section of their interest without the need to scroll the whole page.
hope that will help.
Please see the youtube:
http://www.youtube.com/watch?v=FC95ARd96wI
notice that the 0:35 , the iPad bottom have a thin photo bar. Is it a private API or I need to create my own or Which UI Element will it be? Thz.
That's definitely a custom job. However, it's basically a UIToolbar with a fancy slider on it. You can easily make the toolbar using Interface Builder, and you could take a simple stab at the slider by taking a regular UISlider and giving it some replacement images for its track, thumb, etc. See the documentation on UISlider.
If that doesn't quite work, then you're going to have to get down and dirty in UIControl code and make on yourself from scratch (or hope and pray that someone has written an open source version already).