问题
I developed a quite popular news app for a newspaper. Unfortunately, my users reported the following problem that I can reproduce:
The App basically consists of a GroupedItemsPage and a ItemDetailPage (and several other pages, not important here). The GroupedItemsPage shows the news grouped by category. As the user scrolls to the right, he clicks on one of the items of interests, gets redirected to the ItemDetailPage and navigates back. Back on the GroupedItemsPage the view jumps back to the first group and does not stay at the last position (group) the user has been. The exact same behaviour can be found (in my environment) when I create a new Windows Store "Grid App".
Unfortunately, I was not able to resolve this problem on my own, nor have I found some useful comments in the web. I saw several other apps who could solve this issue and others didn't. Any comment would be very much appreciated. Thank you!
回答1:
You need to implement this by your self. When navigating from GroupedItemsPage to ItemDetailPage you need to remember the click item. Then, when you navigate back to GroupedItemsPage you need to scroll to the remembered item. You can do it by using the ScrollIntoView method on your GridView.
回答2:
I found another, easier solution. I'd like to share it:
In the GroupedItemsPage (XAML) i added:
<common:LayoutAwarePage
NavigationCacheMode="Enabled" ...
来源:https://stackoverflow.com/questions/14605103/groupeditemspage-view-jumps-back-to-start-when-navigating-back-from-detailpage