我尝试使用lib\internal\cm\cache\backend\Redis.php
方法以编程方式转到所有方法中的另一个视图,例如setCurrentTabIndex
,但每次都搞砸了。有什么建议如何使用它?
答案 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;
}
}
请尝试这种方法..