i have searched this site back and forth withoutfinding a clear answer for what i want.
i have a detail view which is presented after pressing a cell in a table view, this has a uitextview which displays the content of the cell. in most cases this text will have a url link, which when pressed opens the page in safari.
what i want to do is open the link in a UIWebView which i hae on another tab within my app, is it possible to push this link onto my uiwebview insteadof opening safari?
i am fairly new to coding, all self taught. so if you could explain with some detail itwill be appreciated.
Many thanks in advance
mike
See iPhone SDK - opening links in a UITextView in a web view
Related
I'm completely new to iphone apps. I'm creating an iphone app that is designed in HTML and jquery with phonegap. I want to include a back button on the top like the default one in the iphone. I searched on net but all i found, required view controllers.I don't have multiple views so how can i include a back button on my app. Step by step explanation would be very helpful.
Thanks in advance..:)
Why would you include a "back" button if you don't have multiple views? What exactly will you navigate "back" to?
"The net" is correct, you need a UINavigationController to house a "back" button which would pop a view to the previous view.
Other than a UINavigationController, you could use a UIToolbar and set a button to the left hand corner and give it the title of "Back" to simulate the native appearance — but this would be misleading and pointless.
I don't use PhoneGap, but I am sure there is a way to simulate a NavigationController and manually place a button there. I'm also sure it won't be shaped like a back button either (with the pointy end).
javascript:history.go(-1)
UINavigationController is a native control which is in iOS frameworks. As you are using HTML, jQueryMobile and phonegap you should not be looking at those controls. You should totally work in your HTML pages and CSS for that purpose.
The below page contains that back button in jquery mobile. You should be implementing this in your html page.
http://jquerymobile.com/test/docs/toolbars/docs-headers.html
I'm opening an UIWebView from my iPad Application as a PresentModalViewController and opening google maps "http://maps.google.com/maps?q=London" , everything is working fine but the only problem is when i search places source and destination and click on arrow button the keyboard is not resigning, but it is working fine when i open it in safari.
How to resign my keyboard when i click arrow button inside UIWebview?
Any help is thanks in advance.
I would suggest implementing delegate UIWebViewDelegate and catching the event when the page is being reloaded. I am not sure which arrow button you mean, but I believe that when you click that button the UIWebView loads the previous web page. At that point webViewDidStartLoad should be called, in which you can try to call resignFirstResponder on UIWebView.
I have a UIWebView controller that loads a web page and I would like to add some kind of a bar at the top of the page with refresh and close buttons.
The bar should hide when the page loaded and should show again if the user taps the top part of the page.
Does anyone know how to approach it? Is there any simple way to do that?
UPDATE:
I think I wasn't clear enough with the question, so here are some clarifications:
1. The applications is a standard application that one of the flows opens UIWebView that loads a web page
2. What I'm looking for is a bar that will slide down on top of the web page (loaded in UIWebView) and should help the user overcome a scenario where the web page is not loaded for some reason
3. The bar should hold the back (just close the UIWebView) and refresh (reload UIWebView) operations.
Hope it helped.
Thanks,
Shimix
I'm working on something like this right now and so far, here's what I've come up with. Some of this may be obvious, but important:
Your address bar should be the left navigationItem.
The search bar is the rign navigationItem.
You should animate a cancel button in/out when beginning/ending editing in the URL box.
Safari Mobile uses the Prompt property of the navigationBar to display webpage titles.
To animate the widths of the search/URL bars, use UIView animation when the bar is selected.
It's pretty simple to add a UIToolbar above the webview with UIBarButtonItems that call the webview's refresh, back, and forward methods. You can also add the webviewdelegate methods to your view controller to detect when the page has finished loading and hide/show the toolbar that way.
If you want the refresh and navigation controls to be displayed as part of the html content of the webview itself, that's a littler tricker, but not impossible. You can use the webview's shouldLoadRequest delegate method to detect that those buttons have been tapped, and then take the appropriate action within your viewcontroller. Hiding and showing the nav bar would have to be handled in javascript.
Unless I'm missing a library/project doing this, I don't think there is a simple way to do this.
I have already coded something similar to Safari mobile address bar, and from memory, it involved using private apis and/or playing with the "not so private but use at your own risks" UIWebView subviews hierarchy...
I have a tab bar iphone app. The second tab has formatted text with images so I inserted it as html file to uiwebview. I would like insert links on some parts of the text and on some images in this html file to the first tab view with different parameters. How can I do that?
Create an instance of UIWebViewDelegate,and implement the method:
"webView:shouldStartLoadWithRequest:navigationType:
Sent before a web view begins loading content."
...and implement your code to do things on the first tab when the user clicks any of the "special" links. Also, make sure to return "false" when the link clicked is one of those links, to stop the webview from loading them in the second tab.
My app is a Navigation based application. The main menu contains the list view items. if I clicks one of them, it goes to next view which in this case take me to UIwebview embedded web site. Everything is looking great. I can view the content of web page, the navigation control back button which takes to the main menu if I press it. However, I'm having issue when I try to go back to main menu if i visit that subview the second time. It loads the content of UIwebview web page, but the navigation button is gone and won't let me go back to main menu. This problem only appears on latest iOS 4.2 version. Otherwise it works great on 3.1 to 4.1. I would appreciate any hints or inputs.
Note this seems not working for subview using UIWebview embedded web content. I don't have any issue with other subviews
Can you show us the code ? Did you try this: self.navigationItem.hidesBackButton = NO; in viewDidLoad method where you are adding UIWebView to your view..