How to remove black bar WebView on iOS App? - ios

I put WebView on DetailViewController (From template MasterViewController) and set constraints like below picture. But when navigate to every url, it has a black bar on top and it disappear when scroll down. How can I remove it?
WebView
Constraints set

Set UIWebView background colour to clear. I guess it will help you.

Uncheck Adjust Scroll View Insets from Attributes inspector by selecting view controller.

OK I fix issue by drag top edge of WebView to top of view controller. Now it work with no problem!

If you can't drag WebView to the top of your ViewController -- when you have an extra UI on top of the WebView -- then put a Container View instead and move web view inside it. It will loose the connection to Navigation Controller and will stop drawing that grey placeholder.

Related

change in vertical space of top element in viewcontroller

I have a view controller in navigation stack ... whenever after loading the view controller a change happens in vertical space of top element.
I don't understand why it happens ..
I have set top 5 for the top element of the view controller to the superview
I couldn't fix the problem no matter what ... status bar , top bar ,bottom bar,size are inferred
Info.plist I have set viewcontrollerbasedstatusbarappearance as no and I am setting the status bar as light content in app delegate once..
The problem that menioned not happens with all the view controller only with some viewcontroller it happesn
Thanks for any help
I think that you gave constraint like that,
So, change it as per below,
I hope it will work.
First, click on viewController in storyboard.
So, you will see at a right side corner is like this.
After that, Untick Under Top bars checkbox like that,
I hope this will work.

UIView inside UIScrollerView displays with -64 offset

I'm trying to create a form that will be larger than the screen size and I've decided to use a view inside a scrollerview, then I'm adding the rest of the UI widgets (textfields, buttons, etc.) inside the view.
The view displays and scrolls, but no matter what I try, it displays with a vertical offset of -64 below the navigation controller bar. Once there the view will happily scroll up down.
I want the view to anchored at the top, just below the navigation bar, and then scroll down.
I am using IB.
Lots of time researching and not many answers that have worked for me. UIScrollView seems to be like one of those dirty secrets the whole iOS world seems to avoid....
Thank you for your help.
You can fix this in the storyboard
1- Select the view Controller
2- GO to attributes inspector
3- Uncheck adjust scroll View insets
For your view controller, in the storyboard uncheck the option to extend edges under top bar.

Add a Label to the bottom of a webview

I am trying to add a label to a webview, the label looks like a button and sticks to the bottom of the screen, it transitions to a different view on tap.
Tried adding a tab bar to the webview but the webview does not show the tab bar at all.
Any suggestions on how this can be achieved will be highly appreciated. The link below shows the green label at the bottom of the webview. I am trying to add a similar label on my webview but so far no luck.
http://imgur.com/e0fsy6e
Don't add label to webView. WebView is responsible for drawing its content. Add over subviews above webView, e.g. to webView's superview. Especially if you need to move it to over view later.
Also, want to mention that in provided design I would use UIButton instead of UILabel for "RESERVE CLASS" element.
And pay attention to AutoLayout and LayoutConstraints.

Placing a share button over a uiwebview

I have an rss app that I'm working on in xcode and the articles load up in a full screen web view. I need to place a "share" button in the navigation bar but since my uiwebview is full screen it won't show up when I run the app. I even tried cropping the top of the web view lower and placing the button there but still no luck. Here is an example of what I mean:
The share button needs to be on the right side of the navigation bar but i cannot seem to figure out how that make that work.
Thanks in advance
Fist of all, your top navigation bar seems to be missing (judging by your image). Since the nav bar is missing there is no possible way that the share button will be visible. You can do this is the IB or in your code.
For your IB you can move the view controller's 'layer's' so to speak. When you place all the elements down, your VC should look something like this:
On the left hand side we can see what subviews are at the top and which ones are at the bottom.
As we can see here that the UIWebView is at the top of the list, so it'll be at the bottom of the pile. The navigation bars are further down the list so they'll be at the top of the pile. So due to this they'll go over the UIWebView.
The other way to do this is using insertSubview:aboveSubview:. Fist of all you'll add your UIWebView using addSubview: and then add the nav bar using insertSubview:aboveSubview: and finally you'll add your button the someway as you did for the nav bar, but this time you'll be adding the button above the nav bar not the web view.
My best guess is that your forgetting to add another navigation bar to the top of the screen. Hope this helps!!

aligning UINavigationBar programmatically with other controls added through Interface Builder

If I am pushing a view controller onto the NavController, is there a way when designing this view to have the controls line up correctly?
Here's the issue I'm having, I had to align the TableView and MapView like so to get it to show up properly when loaded into the navcontroller:
This seems wrong. The mapview as you can see overlaps the tableview in the editor, but when it runs their lined up correctly. If I raise the mapview to line up directly on top of the tableview, when run, theres a white gap between the two. I realize the NavBar is pushing things down, or that's my guess.
Is there anything in the Utilities I can set to handle this?
You can manually tell the view controller to show a navigation bar in interface builder in the attributes inspector.
select your view, then in File Inspector, uncheck Use Autolayout. It may helps you.

Resources