Placing a share button over a uiwebview - ios

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!!

Related

White Bar appearing at bottom of each view controller in storyboard but doesn't affect when ran

In my storyboard view these white bars appeared at the bottom of every view. I can't remember what I did when they appeared, the only thing I can think of was that I tried to add a bar button but then deleted it, so maybe that created some sort of bar. However the bar doesn't show up when running the app in the simulator, it just has a visual in the storyboard.
Does anyone know what it is / why it appeared? and also how can I get rid of it. I got rid of a few by changing the view heights and then changing them back, but when trying to do the same in the first view when I clicked the white bar they all appeared again on every view.
Also, I've noticed some are within the view and some are an extension.
This issue is caused by adding a bar button item and then removing it. The fix is pretty easy though. Go to your storyboard and select the View Controller having the issue.
You will then want to go to the Utility area on the right side of your screen. You will see Bottom Bar = Translucent Toolbar. Change that to None and you're good to go.

scrollview on top of navigation bar and toolbar?

I want to know how, if possible, one can keep the scrollview on top of the navigation bar. When I put the scrollview on my view controller it covers the whole screen except for the navigation bar and toolbar. I want to keep it on top of everything.
Use containerView to achieve this because containerView can contain Navigation controller within it like other controller.
And Add scrollView within containerView like below shown -
Hope it will work for you :)
I don't think there is a simple way to put the scroll view "on top of" the navigation bar, and it is certainly something that Apple Devs never intended to be done. Generally (although certainly not always) that means that if you want your code to work consistently as new versions of Swift and iOS are released, you shouldn't do it. The other reason you shouldn't do it (probably) is that unless you setup some sort of fancy "touch through" system you would never be able to actually use the nav bar, at which point you might as well just save the trouble and not have a nav bar in the first place. You can, however, easily check a box in your storyboard to have the scrollview go under the nav bar, and have the nav bar be translucent so that you can see the scroll view content under it.
Good luck!
I think preset modal(UIModalPresentationOverFullScreen) is what you're looking for.

How to design a tabbar inside a view

I need to make this view:
A view on top of the tab bar with some data. (image, name, text, ...)
tab bar has a 3 page and every page has a separate view
When user scroll up, tabbar will be scrolling top of the page and a UILable stands top of tab bar. It can be show with some fading animation (not important right now)
this is after scrolling:
I search in cocopods but I didn't find solution.
---- EDITE
I want to know how to put uitabbar inside a view. Is it possible ?
If yes, How to change just sub view of tab bar when I change tab bars!
I want to know how to put uitabbar inside a view. Is it possible ? If yes, How to change just sub view of tab bar when I change tab bars!
Yes, but I wouldn't describe the thing you are showing in your screen shot as a "tab bar". It is a UISegmentedControl. So all you have to do is respond to the user tapping on a segment of the UISegmentedControl by substituting one view for another, and that's easy to do.

Attach a Segmented Control to UINavigationBar

In my App, I have a map view and I want to use a segmented control to change the map types (Standard, Hybrid, Satellite). The way I have the app set up, the status bar is hidden and it animates in, moving the navigation bar down a bit. To make sure it doesn't look awkward, I want to make it so the segmented control is attached to the navigation bar so it animates nicely as the status bar comes in. This is basically a picture of what I want to do:
So I noticed that the segmented control is inside a toolbar, so I contain mine in a toolbar as well. I've then tried adding the toolbar to the navigationBar as a subview. (self.navigationController.navigationBar). That works well accept that it can't be tapped because the navigation bar's frame doesn't enclose the extra space, so it can't receive touches. I tried making the frame of the bar bigger, and that worked, but the title and the buttons went away. Obviously there is some way to do this, and I would appreciate any help. Thanks.

push up and swap Navigation Bar in iOS

I've seen this being achieved a few months ago in an app (wish I could remember which).
My main screen is a scrollable view (UITableView) that has the default navigation bar on top, and another added navigation bar at the bottom.
When I scroll down (swipe finger up), the bottom navbar will eventually reach the top. What I'm trying to achieve is to make the top navbar be pushed up by the bottom navbar as I'm scrolling and swap it. All in a smooth transition, which will of course work in the opposite direction (be reversible).
Can anyone give me directions on how to go about doing this?
I have thought about creating an animation, but not sure if its actually possible to push up and out of the screen the "default" navigation bar of the view controller.
Thanks.
I think what you are looking at is headers for sections in an UITableView.
See Apple's documentation on UITableView`: Documentation
Specifically, see the headerViewForSectionmethod.

Resources