Add a Label to the bottom of a webview - ios

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.

Related

What if layout height is longer than device height in xcode?

Please take a look at screen shot from simulator for iphone 8 plus. (01.png) Here is my question: I cant see whole view of my page(i cant see whole part of button5 and button6 because there is no vertical scroll bar) Shouldn't vertical scroll bar appear automatically? If vertical scroll bar appears then i can reach bottom of the page. What should i do? Please give me an advice because i haven't founded any solution yet. You can also take a look at screen shot from xcode main story board to see height of button5 and button 6. (02.png) I mean page background should not move. But I should be able to scrolling up and down through on page. Thanks.
01.png
02.png
Just add image view with background image below all components in the ViewController.
Then add Scroll View with your content on top of that image view.
Don't forget to select clear colour as the background for scroll view and the inner view apart from your buttons.
Follow this tutorial to add Scroll view and content in it directly in storyboard using Interface builder.
https://medium.com/#pradeep_chauhan/how-to-configure-a-uiscrollview-with-auto-layout-in-interface-builder-218dcb4022d7

How to remove black bar WebView on iOS App?

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.

tab view like button slides up

I am trying to have a button that is located on the bottom and when the user taps on it it will slide up to show the menu. How is this possible using code or is there an api or anything that I can use to make this possible in the easiest way?
Your screenshot shows a view whose frame is animated when the button is pressed so that either the height of the view, or more likely just the position, is changed so that the view becomes visible. This is a simple UIView animation and the view being added so it is hidden behind the button initially.
Check out the iOS documentation for Animating Views https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html
You should be able to create the view and its content either with the interface builder or in code. Start with the view off the bottom of the screen and then use animateWithDuration:animations: using the frame property.

iOS/Swift: Dynamically Resize a Toolbar

I'm trying to make an app with a toolbar that can be resized. Basically, the toolbar can alternate between being at the bottom of the view and being at the top. When a button is pressed, it switches from one to the other. The problem is that when it is at the top, I want the size of the toolbar to expand to accommodate the status bar, but I don't know how to do this.
I've seen some solutions for changing the toolbar size but they all seem static and not something that can be changed with the tap of a button. Any suggestions on how to do this? Perhaps a different solution altogether?
You can use a normal UIView and customize it so it looks like a UIToolbar, then just set constraints using AutoLayout and animate the height-constraint.

UIWebView inside TabBarController causes content to go behind tab bar

I have a web view inside a tab bar controller. The problem is when using the web view, the content goes behind the tab bar and I cannot scroll to the bottom of the page. How do I resolve this?
Here is how everything is setup in Xcode
If you are using AutoLayout set the constraints of the UIWebView so that it is attached to all the sides.
Edit: Instructions
Select the UIWebView
Select the icon shown in the picture below
Unselect the Checkbox for "Constrain to Margins" because we want to constrain to neighbor
Set the numbers around the center square to 0's
Click the icons that are between the middle square and the numbers you just changed
Click Add Constraints

Resources