Closed renetik closed 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...
I am not clear about your problem. Did you try the example project? What are you trying to do, can you be more specific?
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
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.
@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?
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.