uitabbarcontroller

Pass data between ViewController and TabBarController

独自空忆成欢 提交于 2019-12-21 04:51:33
问题 I have couple of questions. How to pass the data (which i got after the Alamofire request is finished), to one of children of TabBarController? The first problem i have is that i can't override the func prepareForSegue inside login action(when the button is tapped), it says i can override only class members. But if i put the func outside of IBAction then i won't send the data that i need. And the second problem is, when i put the overrided function outside of IBAction, and the code look like

self.presentingViewController returns UITabBarController not the view controller pushing it with presentModalViewController

☆樱花仙子☆ 提交于 2019-12-21 03:57:31
问题 I have a tab based application. One of the views in it is pushing a modal view controller . If I call self.presentingViewController within a modal view controller , it returns tab bar controller , not the view controller which is pushing it. What am I missing here? Is there a reliable way to return a view controller raising modal? Thanks. 回答1: Is this an iPhone app? If so, that explains the confusion. On iPhone, the only presentation style is UIModalPresentationFullScreen - which amounts to

How do I create a UITabBarController with a custom UITabBar class without using IB?

烂漫一生 提交于 2019-12-21 03:29:08
问题 I can create a UINavigationController with custom bar classes by using initWithNavigationBarClass:toolbarClass: . There doesn't seem to be an equivalent for UITabBarController , so how do I get it to use a custom UITabBar class? Every solution I've seen so far is unsuitable because either It uses IB It adds a second tab bar to the UITabBarController instead of changing its existing one, or It throws UITabBarController away and makes a new controller class. I want a real UITabBarController

How to set title of Navigation Bar in Swift? [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-21 03:17:24
问题 This question already has answers here : what would be a proper storyboard example of combining nav bars and tab bars in one app? (2 answers) Closed 4 years ago . I'm trying to set title of Navigation Bar in Swift, I set Tab Bar and in Navigation Bar nothing is showing, no button, no title, nothing. I used some code but it's not working while I use Tab Bar , and when I deleted Tab Bar , code is working and everything is ok with Navigation Bar , title is showing and buttons are showing. Code

Space between custom UITabBar and ViewController

别说谁变了你拦得住时间么 提交于 2019-12-21 02:35:12
问题 I took a regular UITabBar and changed it's background image to a custom one which has a lower height, so I changed the height of the frame . At first what I got is a blank space below the tab bar. so I changed the origin of the frame too. But now the blank space has moved up above the tab bar and this is the result: And this is the code declaring the tab bar in the AppDelegate: self.tabContoller = [[UITabBarController alloc] init]; //customizing the tabbar UIImage * tabBackgroundImage =

iOS : How to add Underline in UITabBarItem

有些话、适合烂在心里 提交于 2019-12-21 01:57:41
问题 I am working in a application where i need to add underline in UITabbarItem . so i would like to add underline under the selected UITabbarItem in Default UITabbarcontroller of iOS. I have already created subclass of UITabbarcontroller but didn't find any way to add line in that. I want to do something like below image. If anyone have any idea for this please share here. 回答1: Please try this one. I have used in my application once and hope it will help you too. This is how I have created Tab

keeping a UIButton pressed(state selected/highlighted),until another button is pressed?

假如想象 提交于 2019-12-21 01:27:29
问题 I have 3 buttons at the bottom of my view controller, btn1 btn2 btn3, I'm using them instead of the tab bar as it is not possible to entirely customize a tab bar as per my requirements. Now the issue is, when btn1 is pressed, I want it to change its image, to a grey rectangle, instead of the normal state image. I have set the images for both states in the outlet I declared for the button, btn1Outlet, using the setimage and uicontrolstate properties of the outlet. The problem is, I can't keep

Navigation bar for split view controller is darker when inside a tab bar controller

♀尐吖头ヾ 提交于 2019-12-20 15:43:10
问题 If you place a split view controller inside a tab bar controller the navigation bar and tab bar are darker on the left side. I've attached a screenshot. I created this by creating a Master-Detail Application and then adding a tab bar controller. How do you correct this issue? 回答1: At the time of writing (May 2017) this bug still exists. I can't believe Apple doesn't take care of this. The worse part is that if you rotate your device, open the master from the side and rotate back, the

how to determine which tabbar index is my view controller

旧街凉风 提交于 2019-12-20 10:57:28
问题 Can somebody please tell me how I can determine which tabbar index a view controller is at. to simplify - I can jump to a tabBarItem at the moment by hardcoding its index. self.tabBarController.selectedIndex = 3; However, should the user customize the tab bar items, there is a possibility the viewController at number 3 isn't the one that the user will want as it has been moved. How can I determine where it has moved to so I can select the correct one. Any help please. Thanks, Lee 回答1: Use the

Which is the best approach for creating custom tab bar controller?

不羁的心 提交于 2019-12-20 10:04:49
问题 I am working on application that is more likely a tabBarController application. But I can not use the tabBarController because I need a custom tab handler at the bottom also I need custom space between items. So I am creating custom tabBarController . I would like to know the best approach. Currently my approach is this in way (using storyboard and iOS6 ) :- I took an UIToolbar on ViewController which will act as a bottom tab bar(CustomTabBarViewController). I took ContainerViews for each tab