I am experimenting with a Tabbed app. One of the Views (tabs) shows a list of items. I want the user to be able to select any item and be navigated into a View that shows details pertaining to the item.
In that subsequent detailed View, is it possible to hide the Tab Bar?
A bit of experimentation suggests that if an app is initially set up as tabbed, then all views must display the Tab Bar.
Because the tab is setup in the iOS Screen that would be the case. Think of the screen is that which holds the views even though each container (single view, tab view, left/right split) can have fully independent views.
I think that want you want to look into iOSToolbar.
[quote=151432:@Bob Keeney]Because the tab is setup in the iOS Screen that would be the case. Think of the screen is that which holds the views even though each container (single view, tab view, left/right split) can have fully independent views.
I think that want you want to look into iOSToolbar.[/quote]
I think I follow you.
iOSToolbar seems to be a good candidate since I can control in on a view by view basis. The only downside I see so far is that iOSToolButtons don’t seem to be able to contain both an image and a caption (like a Tab Bar).
It looks like the Tab Bar can be hidden on a View using a Declare. I googled this up:
ViewController *viewController = [[ViewController alloc] init];
viewController.hidesBottomBarWhenPushed = YES; // This property needs to be set before pushing viewController to the navigationController's stack.
[self.navigationController pushViewController:viewController animated:YES];
I have tried to morph this into a Xojo-friendly declare, with only comical results.
// @property(nonatomic) BOOL hidesBottomBarWhenPushed
Dim v As New View3
Declare Sub setHidesBottomBarWhenPushed Lib "UIKit" _
Selector "setHidesBottomBarWhenPushed:" (id As Ptr, value As Boolean)
setHidesBottomBarWhenPushed(v.Handle, True)
Self.PushTo(v)
[quote=151609:@Paul Lefebvre]Seems like this might work:
// @property(nonatomic) BOOL hidesBottomBarWhenPushed
Dim v As New View3
Declare Sub setHidesBottomBarWhenPushed Lib "UIKit" _
Selector "setHidesBottomBarWhenPushed:" (id As Ptr, value As Boolean)
setHidesBottomBarWhenPushed(v.Handle, True)
Self.PushTo(v)[/code][/quote]
It works great :)
Do you think it could be made into a method for the wrapper ?
I tried wrapping it as such :
[code]Sub hideTabBar(v as iOSView, slf as iOSView)
// @property(nonatomic) BOOL hidesBottomBarWhenPushed
Declare Sub setHidesBottomBarWhenPushed Lib "UIKit" _
Selector "setHidesBottomBarWhenPushed:" (id As Ptr, value As Boolean)
setHidesBottomBarWhenPushed(v.Handle, True)
Slf.PushTo(v)
End Sub
But when I try to call it with
hideTabBar(View1,self)
I get
Expected a value of type class View1.View1, but found a static namespace reference to class View1.View1.
The method hideTabBar is now part of the wrapper. I also found how to reinstate the tab bar : simply go self.close on the pushed tabless view.
That would be real great. I am battling at the moment the lack of this feature.
On Tab1 I have a view (‘Letter)’ that displays a letter for children to copy
On Tab 2 the user picks a new letter to display using the keyboard (‘Pick’ view). When the letter has been found, I PushTo a copy of the Letter view.
Then what happens is that if I tap on Tab 1 or Tab2, nothing changes. I will have to tap twice on Tab 2 to get the Pick view.
If I close the pushed view in deactivate, the Pick view takes over, so I cannot go to another view.
This is messy.
It would be greatly better to actually activate a tab by code.
Jason, you talked about that before, but have you filed a feature request ?
Yes, a month ago: (https://xojo.com/issue/36718)>] . It’s also pretty important for my app which has a Dashboard as the first tab summarising important data in the other four tabs. In our web app you can tap a dashboard widget to go straight to the items needing attention but I can’t do that under iOS as I can’t programmatically select the tab.
I had forgotten I participated in the feedback as well. Let us hope it is doable.
My current issue with pushed views is also that there is no way to know if a view is the default one or the pushed one. Currently, I just found out that the default one has a TabTitle, and the pushed one does not. But no way to know how many views are in the pile or their title. As if you had opened several windows in a desktop app and could not know which ones they are.