gpt4 book ai didi

ios - 如何为 UISegmentedControl 上的 tableView 重新加载设置动画点击作为 pushviewcontroller

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:58:28 24 4
gpt4 key购买 nike

我已重新定位段点击时的 UITableview 数据,如下图所示:

enter image description here

现在我想在 UISegmentedControl 上为 tableView 重新加载设置动画,与 navigationController pushViewController 相同,但是在 table view 的移动之间出现过渡屏幕

我已经尝试使用以下但无法完全获得我想要的 -(void)SwipeGestureRecognize{

    UISwipeGestureRecognizer * swipeleft=[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeleft:)];
swipeleft.direction=UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeleft];

UISwipeGestureRecognizer * swiperight=[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swiperight:)];
swiperight.direction=UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swiperight];



}
-(void)swipeleft:(UISwipeGestureRecognizer*)gestureRecognizer
{
//past Order

[UITableView animateWithDuration:0.5f animations:^{
self.tableView.frame = CGRectOffset(self.tableView.frame, [Util window_width],0);

}];

self.tableView.frame = CGRectMake(0, 0, 0-[Util window_width], [Util window_height]);

[UITableView animateWithDuration:0.5f animations:^{
self.tableView.frame = CGRectOffset(self.tableView.frame, [Util window_width],0);
}];



segmetControl.selectedSegmentIndex = 1;
[self action:Nil];

}

-(void)swiperight:(UISwipeGestureRecognizer*)gestureRecognizer
{
//Current Order

[UITableView animateWithDuration:0.5f animations:^{
self.tableView.frame = CGRectOffset(self.tableView.frame, [Util window_width],0);

}];

self.tableView.frame = CGRectMake(0, 0, 0-[Util window_width], [Util window_height]);

[UITableView animateWithDuration:0.5f animations:^{
self.tableView.frame = CGRectOffset(self.tableView.frame, [Util window_width],0);
}];


segmetControl.selectedSegmentIndex = 0;
[self action:Nil];
}

最佳答案

我会建议您在顶部使用 UICollectionView 并制作包含 UITableView 的 View 宽度的自定义单元格当段控件值发生变化时:滚动到您要使用的特定单元格。还记得制作

CollectionView PagingEnabled = YES

关于ios - 如何为 UISegmentedControl 上的 tableView 重新加载设置动画点击作为 pushviewcontroller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30937413/

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