Bottom layout guide prevents interaction with the uitoolbar which is exchanged with the uitabbar - ios

I am trying to make it possible to exchange the tab bar with the tool bar on iOS when the UITableView enters the editing mode.
However, when I set the
func updateBottomBar() {
tabBarController?.tabBar.isHidden = isInEditMode
actionToolBar.isHidden = !isInEditMode
}
, everything displays correct, however I can not interact with the toolbar. It seems like it is under the bottom layout guide, and the touches cant pass through. I tried bumping the toolbar.layer.zposition to 100, didnt work.
Note: if I programatically reposition the ToolBar to be a little bit higher, then exactly the portion of the ToolBar which is above the top of now hidden TabBar will be okay to interact with. Say i put the ToolBar 20points higher, then the 20 top points of the ToolBar allow me to press the buttons, and the bottom part doesn't allow.
I have:
extended edges under bottom bar disabled
Hides bottom bar on push disabled
user interaction enabled
right now. Changing those didn't give any success.

One possible issue could be your userInteraction of your custom tabbar being set to false.
You can do that directly in the your storyboard by opening the attribute inspector on your ActionToolBar
Also, to confirm you don't have any invisible view on top of your custom toolbar, you can use debug the view hierarchy when running on your simulator:

Related

How to make a toolbar visible all the time in Swift?

I made a toolbar at the bottom of the tableview.
But when I launch the simulator, the toolbar only becomes visible when I scroll all the way down to the bottom. How can I make toolbar visible all the time?
If you're using a Navigation Controller, make sure to tick "Shows Toolbar" and add the buttons there, not on a standalone toolbar.
In order to show only on some, you'll need 2 different views, one that will hide it and another that won't and add the following to the respective view's viewWillAppear:
self.navigationController.toolbarHidden = YES;
(Set to YES to hide, NO to show)
You can play around with the Simulated Metrics on the Storyboard so as to visually simulate the run-time effect by setting Bottom Bar to either None or Toolbar instead of inferred, as appropriated.
Use below line : self.navigationController.toolbarHidden = false
In viewDidAppear() so that Everytime when your this viewcontroller appears your toolbar will become visible.

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.

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

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.

Search bar partially disappears when switching views in iOS 7

We have a UISearchBar backed by a UISearchDisplayController in our app. Changing screens with the search bar hidden partway under the header causes that portion of the bar to be gone when the user returns, revealing the search bar's background. Here, I have it set to red which shows me that the search frame size and position are still correct.
Tapping anywhere inside the bar brings up the keyboard as expected. However, once the bar moves to the top of the screen, the part that was hidden stops responding to input. This blocks text selection and taps to the top of the Cancel button.
I have experimented with all of the answers in this question without success, so I think our issue is different, though likely related. Does anyone know what's going on, and how we can fix it? Thanks for your input.
If you are running on iOS 7.0 version then you need to set following property which is newly introduced in iOS 7.0 as follows
self.edgesForExtendedLayout = UIRectEdgeNone;
as by default edgesForExtendedLayout property is set to UIRectEdgeAll that means the view controllers use full-screen layout by default. And your's searchbar appeared to be rendered behind the navigation bar, starting from navigation bar offset.

Resources