// // ReadFlowerViewController.m // LekangGuard // // Created by ecell on 2023/7/27. // #import "ReadFlowerViewController.h" #import "MCPageView.h" #import "MyChildViewController.h" #import "OtherChildViewController.h" @interface ReadFlowerViewController () @property (nonatomic , strong) MCPageView * PageView; @property (nonatomic ,strong) NSMutableArray *controllers; @end @implementation ReadFlowerViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.zx_navTitle = GJText(@"小红花"); self.controllers = [NSMutableArray array]; NSMutableArray *titles = [NSMutableArray array]; [titles addObject:GJText(@"我的小孩")]; [titles addObject:GJText(@"其他小孩")]; MyChildViewController *vc = [MyChildViewController new]; OtherChildViewController *vc1 = [OtherChildViewController new]; [self.controllers addObject:vc]; [self.controllers addObject:vc1]; self.PageView = [[MCPageView alloc]initWithFrame:CGRectMake(0, iPhoneX_NavHeight, SCREEN_WIDTH,SCREEN_HEIGHT-iPhoneX_NavHeight) titles:titles controllers:self.controllers]; self.PageView.delegate = self; //self.PageView.titleButtonWidth = Adapted(94); self.PageView.backgroundColor = KKWhiteColorColor; self.PageView.lineWitdhScale = 0.65; self.PageView.lineColor = KKMainColor; self.PageView.selectTitleFont = FontBoldADA_(16); self.PageView.defaultTitleFont = FontADA_(14); self.PageView.defaultTitleColor = KKTextBlackColor; self.PageView.selectTitleColor = KKMainColor; self.PageView.lastItemBackgroundColor = KKClearColor; [self.view addSubview:self.PageView]; [self zx_setPopGestureCompatibleScrollViews:@[self.PageView.titleScroll,self.PageView.contentCollection]]; [self.PageView selectIndex:self.selectedIndex]; } - (void)MCPageView:(MCPageView *)MCPageView didSelectIndex:(NSInteger)Index { NSLog(@"%ld",Index); //MarketEntrustTableView *vc = self.controllers[Index]; self.selectedIndex = Index; //self.viewPage = Index; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end