I'm new to Ionic 3, and what I want to do it's to get the specified scenario:
I go to Tab 1, click on some Item in Tab 1 and go to a view of this item, If I now switch to Tab 2, when I go to Tab 1, the view showed should be the Tab 1 view, not the Item View for a Tab 1 element.
In ionic 1 I previously have used $ionicHistory.clearHistory() but seems now it's not available. I've tried several uses of NavController but seems I am not using it properly or where it means to be used. How can I accomplish this scenario? Also I want to disable the back button in the root Tab 1 view, like, I don't want to see any type of back button when I'm on this view, without any exception.
Thanks in advance!
if any content of some tab link to a new page . the tab should be in hidden state so add this attribute "tabsHideOnSubPages" to your tab tag.
example:
<ion-tabs>
<ion-tab [tabsHideOnSubPages]="true" [root]="tab1Root"></ion-tab>
<ion-tab [root]="tab2Root"></ion-tab>
<ion-tab [root]="tab3Root"></ion-tab>
</ion-tabs>
So in this case when the first tab has button link to another page the state of toolbar tabs will be in hidden state and thats will not happen for second and third tab because the value of "tabsHideOnSubPages" attribute is false by default.
Related
What is the best way to navigate from a tab page 1 to another tab page 2?
The scenario is that I when I press a button in a tab page, it should navigate to another tab page. I can't set the main tab page's selected tab property because I'm in the tab page 1 viewmodel.
Here is my code, this isn't working but is what I intend to do.
NavigationService.NavigateAsync($"{KnownNavigationParameters.SelectedTab}=TabPage2");
The working code is this, but the problem is that it reloads everything since it navigates to another instance of the MainTabbedPage then selects the TabPage2 tab.
NavigationService.NavigateAsync($"MainTabbedPage?{KnownNavigationParameters.SelectedTab}=TabPage2");
If you want to navigate to tab use the following code, I am using this for navigating from a drawer and it works fine hope it will work for you.
var navParams = new NavigationParameters
{
{ "Title", "Page Title" }
};
NavigationService.NavigateAsync("NavigationPage/{Tab Parent Page}/" + {Tab Page}, navParams );
I have a tab layout and I'd like to hide a tab, but when I do that, the view will not show anything. I thought [show] was for the icon, not the view.
<ion-tabs #myTabs id="myTabs" [selectedIndex]="0">
<ion-tab tabTitle="Menu" [root]="menuPage" [rootParams]="clientParams" [show]="false"></ion-tab>
</ion-tabs>
^ this displays nothing but removing the [show]="false" makes the view appear like normal.
Is there a way to allow the view to be seen while removing the icon from the tab bar?
The first part of your question is confusing of what you are trying to do. But I will try to answer the part of "how to remove icon from tab bar"
Normally if you do not have the tabIcon property in the ion-tab tag there wont have any icon show.
However if the tab icon is still showing for you you can set tabsLayout to icon-hide to hide the icon.
<ion-tabs tabsLayout="icon-hide">
<ion-tab [root]="tab1Root" tabTitle="Home"></ion-tab>
</ion-tabs>
Reference:
https://ionicframework.com/docs/api/components/tabs/Tabs/
I am trying to change between two tab pages that have different tabs. Basically what I want is to have a two tab page at the bottom when the app is first opened, but when the user logs in, then change to a four page tab system. I am able to switch between pages, but the tabs stay. setRoot() doesn't work with changing the tabs at the bottom to the new tabs page and neither does pop() or push(). Is there a way to switch between the tabs pages to where they change from a two tab system to a four tab system after a button is clicked?
I know we can pass data to the child tab from parent tab by doing following as described here:
<ion-tabs>
<ion-tab [root]="chatRoot" [rootParams]="chatParams" tabTitle="Chat" tabIcon="chat"><ion-tab>
</ion-tabs>
Is there any way I can do the reverse stuff i.e passing the data from child tab to parent tab.
I have the following scenario:
1. I have "next" button on the the Tabs(parent) page.
2. When user selects the value on the child page then I need to navigate the user to next page based on the selected value when he clicks next.
I have met your problem. you should use Events in Ionic 2 for sending and responding to application level across your app. So you can send data from child tab to parent tab and update status for it.
I created two individual pages - a "home" and a "product" page. I want to add these to a page navigation bar. So, this page should contain a navigation bar and two menu elements named "HOME" and "PRODUCT".
How can I achieve this using dotCMS?
In the page properties, check the box "show on menu" for both your pages. Then you can use the navigation tool ($navtool) to build your navigation. See this page in the documentation:
http://dotcms.com/docs/latest/NavigationTool