gpt4 book ai didi

ios - 在CarbonKit中哪里使用setCurrentTabIndex?

转载 作者:行者123 更新时间:2023-11-30 13:04:49 26 4
gpt4 key购买 nike

我尝试过使用 setCurrentTabIndex 方法以编程方式在所有方法(如 didMoveAtIndex)中转到另一个 View ,但每次都会变得困惑。有什么使用建议吗?

最佳答案

 - (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;
}

}

请尝试这个方法..

关于ios - 在CarbonKit中哪里使用setCurrentTabIndex?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39528217/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com