08-26-2013 11:09 PM
I'm a little confuse of whether to use nav.pop() or nav.navigateTo(nav.at(0)).
In my main.qml, I have 3 buttons, which nav to page1.qml, page2.qml and page3.qml respectively.
While in page1, I have a back button which navigates to main.qml, and 2 button which navigates to page2 and page3 respectively, same for other pages.
My problem is
- when i use nav.pop(), main->page1->page2->when i pop it goes to page1
but what i want is when user click back, i want it to go to main instead of the previous page.
- when i use nav.navigateTo(nav.at(0), main->page1->page2->when i pop it goes to main
but when from main goes to page1 again, whatever data user typed in are still there.
so which one should i use, if i want main->push page1-> push page2->click back to navigate to main and remove whatever is on top of the main in the stack?
thanks in advance.
08-27-2013 12:20 AM