Closed ishigo1987 closed 7 years ago
While you can set the background of the NavigationView
, it will not be visible through a page which has its own background. You can set the page background to transparent but that will show pages underneath when animating page transitions which is most likely not what you want.
btw... to set the background of your entire app window you would change the contentView
background:
tabris.ui.contentView.background = 'red';
hello i have 3 questions Is it possible to have a back button when i jump to one navigationView to another one?if yes how can i enable it? Did you provide an event to handle the back button? thank you
Yes, it's as simple as appending a Page
to your NavigationView
.
tabris.app
has a backnavigation
event.
please can you answering to my questions more carefully i want to understand very deeply
can i have an example to how can i use the backnavigation event?
Sorry, forgot to include the link to the stacked pages snippet for your first two questions.
thank you for the snippet about the backnavigation about my first question i think that i can't explain exactly my problem I try again i have one navigationView(A) with some pages inside and i have another navigationView(B) with some pages too My question: Is it possible to have a back button to jump to B -> A, how can i enable it
Adding to the snippets that @cookieguru already posted... this one is interesting when having multiple NavigationView
instances: https://github.com/eclipsesource/tabris-js/blob/v2.0.0-beta1/snippets/navigationview-tabfolder.js#L52
@ishigo1987 Regarding your question... could you elaborate what you mean by "jump to B -> A"? Do you mean the physical back button or the back arrow on the NavigationView
?
the back arrow on the navigationView.i want to know if i can have a back arrow to back to B navigationView to A navigationView
@ishigo1987 you will receive a disappear
event when a page in the nav view is removed. Maybe that can help you. https://tabrisjs.com/documentation/latest/api/Page#disappear-widget
ok thank you
but my problem persist because i want to be able to go to B navigationView to A navigationView by press on the back arrow.you didn't provide this between 2 navigationView just between the pages inside one navigationView
So basically you want to intercept the back event from the navview and perform some arbitrary other action?
yes and i want that the user see the back arrow
Thanks for the input. We will consider this feature.
ok
@ishigo1987 Is your request the same as #880?
We have discussed the issue again, but due to the nature of the iOS NavigationController used in Tabris.js, we are not able to intercept the back event in a cross platform manor as discussed in #880. Additionally you can also edge-swipe on iOS which is technically similar to the back button press but can not be intercepted.
hello actualy i have this problem on android not on ios
i try one more time to explain my problem. OS:Android i have two differents navigationView with two differents pages
let navigationA = new tabris.NavigationView({
left: 0, top: 0, right: 0, bottom: 0, toolbarColor:themeColor, titleTextColor:"#fff"
}).appendTo(tabris.ui.contentView);
let pageViewA = new tabris.Page({
title: `Connection`,
background:`#fafafa`
}).appendTo(navigationA);
let navigationB = new tabris.NavigationView({
left: 0, top: 0, right: 0, bottom: 0, toolbarColor:themeColor, titleTextColor:"#fff"
}).appendTo(tabris.ui.contentView);
let pageViewB = new tabris.Page({
title: `Connection`,
background:`#fafafa`
}).appendTo(navigationB);
inside the pageViewA i have some kind of link to bring the user on the NavigationB->pageViewB when the user is on the pageViewB he has no back arrow to back to NavigationA->pageViewA My question is how to enable the back arrow in this case??
Don't create a NavigationView
for the second page. Just create a Page
and open it. See https://github.com/eclipsesource/tabris-js/issues/1135#issuecomment-279942579
I create another navigationview because i want to have a good animation like whatsapp by example(one view slideUp and cover the previous one) it's not possible inside the same navigationView(because i animate the navigationView not the page)
@ishigo1987 Two things come to mind.
If you want to create a custom animation you can set the animated
property on the NavigationView
to false and create your own custom animation on the page (or rather its content).
When you need to maintain the two different NavigationViews
you could try to create a dummy page on navigationB underneath the pageViewB. Thereby you will see a back button on the navigationB. If you now set the animated
flag to false you could use the disappear
event on pageViewB to switch back to the navigationA.
2-When you need to maintain the two different NavigationViews you could try to create a dummy page on navigationB underneath the pageViewB. Thereby you will see a back button on the navigationB. If you now set the animated flag to false you could use the disappear event on pageViewB to switch back to the navigationA. @mpost I admit I am a little bit lost with your second explanation. Please can you provide me a snippet thank you
@ishigo1987 The idea is to disable animations and to use the disappear
event to perform any logic you like (eg to show navigationA).
with the back arrow?
@ishigo1987 Yes, when the back arrow is pressed it will fire the disappear
event on the page.
cookieguru please please please can i have a snippet to describe the situation with navigation A and navigation B
Closing this for now. Please create a new issue when questions remain.
Hello i want to set the background behind the navigationView i have no result when i set tabris.ui.set({ background: "red" }); How can i do?