UIWebView not showing the wikipedia search bar - iphone

I am using UIWebView to provide a simple browser in an app. When I go to Wikipedia the search bar at top of the page (mobile version) is never shown in the UIWebView. Scrolling down and back up does not make it visible.
I tried both cases (YES/NO) for scalesPageToFit but did not do anything.

The problem is that Wikipedia is reading the user agent string and deciding not to show the search bar. (UIWebView's user agent is slightly different than mobile Safari's user agent.) Unfortunately, it looks like you cannot change the user agent string used by UIWebView.

Related

How to Make Links Work in WKWebView and how to correctly format words

I am coding a simple app in Xcode and I have ran into a problem. I can not get links to work on the mobile app that go to other links. For example, if I click on the Twitter button at the bottom of the webpage nothing happens, I want that button to lead to the desired link it was supposed to go to. Also, the words in a page on the site are lined up in a vertical column, and I would like to know how to make the text look better in terms on formatting it correctly. Here is a picturePicture Of Simulator The Code
[Image]
Seems like you're adding your WKWebView the right way and the page is loading fine. The problem with the text is actually coming from the CSS of the site as I have the problem in Safari on my phone as well, so if you are the web admin of the site I'd fix it there.
Did you try if the button you are talking about is responsive when accessing through Safari on your phone/simulator? WKWebView does not have a loading bar and it seems "unresponsive" sometimes even though the sites are loading in the back.
When adding your WebView implementation buttons like the privacy policy on the site work fine for me.

How detect if user view app in facebook frame or not?

I have disable scroll in my app, so there is only scroll from facebook - it looks cute and I like it, but if came to my app directly on site, there is also no scroll bar. I tried to detect if user load page with url http://mysite.com or http://apps.facebook.com/myapps, in both ways I get the same direct address link, so I cant detect if user view my app via facebook and I need to hide scrollbar or view it on site and I need to show scrollbar. So is there a way to detect how user view my app?
What server side language are you using? If you are inside the facebook iframe, your page will be requested with a post variable set called signed_request. You can check if that has been set in your code, if it has you know you are inside the facebook iframe, if it's not then you are on your site. From here you could either conditionally change your css to allow the content to overflow properly and get scrollbars, or redirect them into the facebook app.

Customizing the Facebook view

I need the lightblue bar to scroll up (hide) and display the Facebook bar. For example look at this image.
I need the light blue bar (which contains the search bar, refresh button) to be scrolled up, so it hides and displays from the Dark Blue Facebook bar as shown in this image.
I have seen this in many applications but, how can i implement it in my application programatically ?
There's no way to control safari from your app, and since Facebook serves the HTML there's no way to alter that either. So to achieve what you're looking for you could create your own UIWebView and present it modally instead. The issue you'll have here, though, is that you won't have access to the users cookies, so they'll have to log in to Facebook again.

What does apple-mobile-web-app-status-bar-style do?

What does
<meta name="apple-mobile-web-app-status-bar-style" content="black">
do -- can someone explain with an example?
I found this line in the official Safari Developer Library
This meta tag has no effect unless you
first specify full-screen mode as
described in “url.”
But which url?
What is the benefit of this meta tag?
First, the apple-mobile-web-app-capable hint has to be set for that to even work. This hint causes a web application to run in full-screen mode: it removes the address bar and navigation buttons you get by default in Mobile Safari. The removed areas are highlighted in red here:
So, once an app is in full-screen mode (i.e. the user has added the website to their home page), you can also control the colour of the remaining thin status bar at the top of the page with apple-mobile-web-app-status-bar-style, highlighted in red here:
Per the docs:
If content is set to default, the status bar appears normal. If set to black, the status bar has a black background. If set to black-translucent, the status bar is black and translucent. If set to default or black, the web content is displayed below the status bar. If set to black-translucent, the web content is displayed on the entire screen, partially obscured by the status bar.
A couple of caveats:
This only works on the first page you load; any navigation away to another page will make the address bar and navigation buttons reappear. So if you want this to work, you have to build a single page website (for multiple 'pages' consider an Ajax page loading approach such as that used in the jQuery Mobile framework).
This only works when you arrive at the web page via an application shortcut icon; if you navigate to the website directly from within Mobile Safari it has no effect.
It changes the top bar w/ the banner and carrier on it and makes it a translucent black.

Link Target in iPhone Based web app

I am building a web application that is to be run by adding the app to the home screen. Currently it has a list of users, clicking on a user takes you to a detail screen for that user and on that screen is a notes link to take the user to another screen with a grid of notes and a text box to add more notes.
When any links are clicked/tapped, the link is opened in Safari, not the current full screen Safari instance. I tried setting the target of the link to _self, but this had no effect.
Any ideas?
I learned a full screen iPhone webapp can only be a single web page. Any link you try to open will launch Safari instead of replacing the current page. To combat this, I used asp.net postbacks with panels to hide/load/show requested data.
I use target="_webapp" and it works just use for example <a href="http://your.link" target="_webapp"> and it gonna open the link without exit landscape (full screen) i dont know why but with some of my webapps works and sometimes dont.