哪里可以在CarbonKit中使用setCurrentTabIndex?

时间:2016-09-16 09:37:18

标签: ios objective-c swift cocoapods

我尝试使用lib\internal\cm\cache\backend\Redis.php方法以编程方式转到所有方法中的另一个视图,例如setCurrentTabIndex,但每次都搞砸了。有什么建议如何使用它?

1 个答案:

答案 0 :(得分:0)

 - (UIButton *)viewAllBtns:(int )tag {
  UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  [btn setTitle:@"View All" forState:UIControlStateNormal];
  [btn setTitleColor:viewAllBtnColour forState:UIControlStateNormal];
   btn.tag = tag;
  [btn addTarget:self action:@selector(viewAllMethod:)forControlEvents:UIControlEventTouchUpInside];   
  [containerView addSubview:btn];
return btn;
}
 - (void)viewAllMethod:(id)sender {
   UIButton *button=(UIButton *)sender;
   switch([button tag]){
     case 1:   [dashboardVc.carbonSwipeNavigation   setCurrentTabIndex:1]; break;
     case 2:   [dashboardVc.carbonSwipeNavigation   setCurrentTabIndex:2]; break;
     case 3:   [dashboardVc.carbonSwipeNavigation   setCurrentTabIndex:3]; break;
    default: break;
}

}

请尝试这种方法..