Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

How to add a View in the bottom of ViewController for use as bottom bar #37

Closed
subhash08 opened this issue Aug 28, 2015 · 5 comments
Closed

Comments

@subhash08
Copy link

i want to add a view in the bottom of viewcontroller, for use as BottomBar .
like in this pic
screen shot 2015-08-28 at 4 53 29 pm

@subhash08
Copy link
Author

i did it
sorry for posting issue before do my best.

@gustavogervasio
Copy link

@subhash08 how?

@subhash08
Copy link
Author

@gustavogervasio
find - (void)viewDidLayoutSubviews method in CarbonTabSwipeNavigation.m than
in following line

    pageController.view.frame = CGRectMake(pageController.view.frame.origin.x, pageController.view.frame.origin.y, self.view.bounds.size.width, pageController.view.frame.size.height-60);

change the height of pageController, In my case I just want to add a view with height of 60 then I then i change height pageController.view.frame.size.height-60 then after I add my view and other objects.
Hope it may helps.
Happy coding.

@gustavogervasio
Copy link

thanks... 👍

@dewanshuBuzzyears
Copy link

override func viewDidLayoutSubviews() {

    view.addConstraint(NSLayoutConstraint(item: carbonTabSwipeNavigation!.view, attribute: .top, relatedBy: .equal, toItem: self.topLayoutGuide, attribute: .bottom, multiplier: 1, constant: 0))
    
    view.addConstraint(NSLayoutConstraint(item: carbonTabSwipeNavigation!.view, attribute: .bottom, relatedBy: .equal, toItem: self.bottomLayoutGuide, attribute: .top, multiplier: 1, constant: -60))
    
    view.addConstraint(NSLayoutConstraint(item: carbonTabSwipeNavigation!.view, attribute: .leading, relatedBy: .equal, toItem: self.view, attribute: .leading, multiplier: 1, constant: 0))
    
    view.addConstraint(NSLayoutConstraint(item: carbonTabSwipeNavigation!.view, attribute: .trailing, relatedBy: .equal, toItem: self.view, attribute: .trailing, multiplier: 1, constant: 0))
    
    
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants