An open source control written by myself, highly imitated iOS version netease Cloud music discover music and search music results page sliding left and right switching effect, as shown in the figure:
Dynamic diagram can not be displayed please click here
Static images are not available please click here
It’s easy to use. You just need to
LJTabPagerVC *pagerVC = [[LJTabPagerVC alloc] init];
Copy the code
Then give pagerVC an array of UIViewControllers and pagerVC will automatically adjust the spacing of buttons on the pagerTabBar: pagerVC.viewControllers = @[controller1, controller2, controller3, controller4, controller5, controller6, controller7, controller8];
But before you do that, you must first assign the title property of the viewController in the array, which is the text displayed above the pagerTabBar
TableViewController *controller1 = [[TableViewController alloc] init]; Controller1. title = @" controller1 "; TableViewController *controller2 = [[TableViewController alloc] init]; Controller2. title = @" controller2 "; TableViewController *controller3 = [[TableViewController alloc] init]; Controller3. title = @" controllerstation "; TableViewController *controller4 = [[TableViewController alloc] init]; Controller4. title = @" "; TableViewController *controller5 = [[TableViewController alloc] init]; Controller5. title = @"; TableViewController *controller6 = [[TableViewController alloc] init]; Controller6.title = @" controller6 "; TableViewController *controller7 = [[TableViewController alloc] init]; Controller7.title = @" controller7.title "; TableViewController *controller8 = [[TableViewController alloc] init]; Controller8.title = @" ";
Copy the code
If you want a viewController to be notified when it is selected or dropped, simply make it obey the LJTabPagerVCDelegate protocol and implement the – (void)hasBeenSelectedAndShown method.
By default the background color of pagerTabBar is translucent, you can also customize its background color through the tabBarBKColor property of LJTabPagerVC.
You can customize the color of the scroll bar through the selectedLineColor property of LJTabPagerVC.
You can customize the color of the selected button through the selectedTabItemColor property of LJTabPagerVC.