所以我遇到的问题是我有一个CollectionView根据index. 例如,如果我在index 0,第一个cell是“帽子”,然后我切换到index 1,第一个cell是“外套”。问题是如果我点击“外套”然后点击Back button...它显示外套但我们真的还在“帽子”上。如果您单击“外套”,它将显示“帽子”的详细信息。
我之前通过CollectionView在按下back button... 时重新加载来解决了类似的问题,但这次似乎不起作用。所以我想要做的是确保在重新加载之前segmented control index设置为0。
这是我到目前为止从帽子/外套得到的东西detailview:
UserViewController *userVC = [[UserViewController alloc] init];
[userVC.collectionView reloadData];
这是segmented controlin 的代码UserViewController:
HMSegmentedControl * segmentedControl = [[HMSegmentedControl alloc] initWithFrame:CGRectMake(0, 280, 600, 50)];
[segmentedControl setSelectedSegmentIndex:0];
我无法弄清楚从detail view. 或者,如果这不起作用,就让它重新加载整个视图。