shabib87 / SHViewPager

A simple view pager for iOS. Compatible with iOS 8.0 or later.
https://www.codewithshabib.com
MIT License
125 stars 25 forks source link

I dont see tabs, just content , I can swipe controllers... #28

Closed renetik closed 7 years ago

renetik commented 7 years ago

When I pause debug I see that topTabScroll has zero height. index indicator image view is also zero height. header tittle label has height 18 but I dont see it eather. What to do ?

I setup way that I changed one view to SHViewPager in designer xib. Implemented everything as written on page.

renetik commented 7 years ago

Also i tried other possibilities like creating scroll view for contentCroll and topTabScroll and connected them to outlets in SHViewPager view... now i dont see anything...

shabib87 commented 7 years ago

I am not clear about your problem. Did you try the example project? What are you trying to do, can you be more specific?

renetik commented 7 years ago

Nothing Special I just don't see buttons, swiping works. Extended your controller.

@implementation Test2Controller {
    NSArray<ArticleCategoryController *> *_controllers;
}

- (instancetype)construct {
    [super construct];
    _controllers = @[
            [ArticleCategoryController.new construct:@"Články" :@"1"],
            [ArticleCategoryController.new construct:@"Sport" :@"2"],
            [ArticleCategoryController.new construct:@"Cestování" :@"3"],
            [ArticleCategoryController.new construct:@"Motoakce" :@"4"],
            [ArticleCategoryController.new construct:@"Reportér" :@"5"]
    ];
    return self;
};

- (void)viewDidLoad {
    [super viewDidLoad];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    [self.view reloadData];
}

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    [self.view pagerWillLayoutSubviews];
}

- (NSInteger)numberOfPagesInViewPager:(SHViewPager *)viewPager {
    return _controllers.count;
}

- (UIViewController *)containerControllerForViewPager:(SHViewPager *)viewPager {
    return self;
}

- (UIViewController *)viewPager:(SHViewPager *)viewPager controllerForPageAtIndex:(NSInteger)index {
    return _controllers[(NSUInteger) index];
}

- (NSString *_Nonnull)viewPager:(SHViewPager *_Nonnull)viewPager titleForPageMenuAtIndex:(NSInteger)index {
    return _controllers[(NSUInteger) index].categoryTitle;
}
@end
captura de pantalla 2017-02-27 a las 13 30 25
renetik commented 7 years ago

Ok man I quit implemented although not maintained but working XLPagerTabStrip 3.0 - last objective c version tag, project is now full swift. Cannot waste more time with tabs in this app.

diliplilaramani commented 7 years ago

@rene-dohan , I was facing same issue. Your navigation bar is hiding those buttons. Just put "self.navigationController.navigationBarHidden = YES;" in your viewDidLoad and it will work.

But the problem is I am not able to shift menu buttons after navigation bar. @shabib87 can you help?