所以我遇到的问题是我有一个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 control
in 的代码UserViewController
:
HMSegmentedControl * segmentedControl = [[HMSegmentedControl alloc] initWithFrame:CGRectMake(0, 280, 600, 50)];
[segmentedControl setSelectedSegmentIndex:0];
我无法弄清楚从detail view
. 或者,如果这不起作用,就让它重新加载整个视图。