Producing icon resources was never the fun part of app development. You can style them on the TabStrip component together. !!iOS Limitation!! You can’t style individual TabStripItem components on the iOS Tabs component. font (together with the individual properties).The important thing is, it’s now possible to achieve more.Īs you can see the TabStripItem components also support the :active pseudo selector that allows you to style them in their selected state.Ĭurrently, there are only four supported CSS properties to bring feature parity with the TabView component. View a Playground example with Tabs StylingĪdmittedly, it’s not the best design decision to have tabs with different contrasting colors, but I’ll leave the design to you. This new markup is perfectly tailored for styling with CSS and we can now forget about the weird properties like selected-tab-text-color and use the regular CSS selectors and pseudo selectors. Of course, binding varies based on framework. There is no need for directives and such. Īn added benefit of this markup declaration is that it’s now the same across frameworks. Here is an example of the new markup with the BottomNavigation component. Can contain any layout component or a new tab component. TabContentItem - represents the content section of each tab that is navigated to when the respective tab is selected.Can contain two child components - Image and Label - which represent the title and icon of the tab. TabStripItem - represents a single tab.TabStrip - represents the whole set of tabs.There are three new child components for BottomNavigation and Tabs. In order to get the most of it, we had to create component representations for each visible unit that you would want to style. It turned out markup is pretty important for CSS styling. The new components also come with new markup. See a Playground example with Tabs and BottomNavigation CombinationĪs you can see there is some styling here. This was previously impossible or very hard to achieve. Technically, it provided navigation with tabs, but in reality it was hard to use and figure out and also, it was hard to maintain.Īnother benefit from having two components is that you can now combine them - have Tabs on the top with BottomNavigation on the bottom. One of the problems of the TabView component was that it tried to combine these two sets of behaviours in a weird way - for Android it effectively had the Tabs behaviour, while for iOS it did the BottomNavigation one. Use the Tabs component when you want to create sort of a pager to browse between items that have the same context. Use the BottomNavigation for high level navigation where the separate tabs don’t have shared context. Here is a table that displays the behavioural differences between the two:Īs you can see, these are two different components with different behaviour and both have their use cases. As I mentioned, we took heavy inspiration from Material Design, so you can check the respective articles about BottomNavigation and Tabs usage for some explanation and examples in terms of design. The BottomNavigation and Tabs components are separated by function. The New Components in Townįirstly, I must explain why we decided to go for two separate components. Tip: Be sure to check out the custom tab bar at the end for maximum coolness overload. These two new ones are so much better you should forget about the TabView entirely. We also took inspiration from Material Design to separate the components by function and thus, we have two components in place of the TabView: BottomNavigation and Tabs. Ultimately, we decided on a complete redesign that included a new approach to markup, styling, and customization. Picking these one-by-one didn’t work out very well and we took a more holistic approach to figure out what was wrong. The issues ranged from bugs and difficulties in use to unsupported scenarios and limitations. Given the component’s importance to the overall app navigation we wanted to fix this. Some time ago we identified the TabView as one of our most problematic components in terms of reported issues. Now, with version 6.1 they are finally out of beta. They are dubbed BottomNavigation and Tabs and are meant to be new and better alternatives to the existing TabView component. In NativeScript 6 we introduced two new tab navigation components to the core modules suite.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |