guilhermearaujo / GUITabPagerViewController

MIT License
454 stars 69 forks source link

Constraints #2

Closed sergey-zhuravel closed 9 years ago

sergey-zhuravel commented 9 years ago
  1. If I have three tabs, and run the application on the iPhone 6 or iPhone 6+, the tabs are on the left side, not in the center. Or stretch the tabs on the width of the screen. So it will be more beautiful ;) ios simulator screen shot iphone6
  2. When I ViewController is tied to his NavigationController, the tabs are raised up and hide behind NavigationBar. ios simulator screen shot thank you ;)
guilhermearaujo commented 9 years ago

Check the build https://github.com/guilhermearaujo/GUITabPagerViewController/commit/7cbed10d402699ebf30129c8ea0a3f44288f956c to see if it solves your alignment issue. I opted for centering the tabs without changing their widths. I may try later another branch increasing their width to see which looks better.

As for the insets with the translucent navigation bar, I am yet to think how to fix that. If you do have some time (more than I do), a pull request will be appreciated.

Urkman commented 9 years ago

There are some problems related to this: Take a look at my fork, there are some of them solved: https://github.com/Urkman/GUITabPagerViewController

You can solve your problem, by disabling "Under Top Bars" for your ViewController...

Urkman commented 9 years ago

And also call [self reloadData] is viewDidAppear, because in viewDidLoad the frames are not calculated...

sergey-zhuravel commented 9 years ago

Thank guilhermearaujo, this build (7cbed10) helped me :) it would be more good to tabs stretched the width of the screen. And also will wait corrections to navigation bar ;)

Thank you very much!

guilhermearaujo commented 9 years ago

Centered tabs were merged into the master branch. The view controller being extended under translucent bars has been fixed too, and reloadData is being called within viewWillAppear:. Tabs will also be redrawn on orientation changes.

All that is available on the new release 0.0.2.

@sergio-men regarding the tabs with extended widths, I would rather not implement that feature because if a user decides to provide a UIView instead of an NSString, that could deform the views. I would not like that to happen.

In your case, what you could do is to manually create your views with a single label and adjust their width so the group of tabs match the view's width.