Closed jsuarezruiz closed 4 years ago
Can we see the C# sample in MVU?
It would be really helpful for some usage scenarios (e.g. mine) if the TabView behaviour was extended so that, if the display was wide enough, the tabs would 'unwrap', which is to say, they would show the contents of all the tabs across the screen. This allows a neat 'responsive design' which works really nicely with tablets.
On a phone, or a tablet held in portrait mode, the user sees a tabbed view with one pane shown on screen, and the other panes reachable via the 'switch tab' gesture; but when the tablet is rotated to landscape mode (or if on a desktop machine with a wide enough screen) the screen shows all the panes at the same time, next to one another, across the screen.
Icon to be of type View instead of ImageSource please. We want to show notifications (usually as small dots on the top corner of the tab icon)
Icon to be of type View instead of ImageSource please. We want to show notifications (usually as small dots on the top corner of the tab icon)
@MhAllan I believe that would be accomplished using the TabViewItem properties BadgeText, BadgeTextColor, BadgeTextColorSelected, BadgeBackgroundColor & BadgeBackgroundColorSelected.
I notice BadgeText seems to have the wrong type listed, I'm sure it is supposed to be String, not Bool.
@irongut , Thanks for the note. I think those are wrong design as well. There shouldn't be something like a BadgeText.
If we think of a framework that can meet future requirements we shouldn't limit developers with types like String or ImageSource. If do so then we will soon get issues like this: Make Badge Corner Rounded, Made Badge Bigger, Smaller, Shadow, Left to the Icon, Up, Down, Right, in front of the icon, behind the icon, Animated ... etc. And people will get frustrated they can't customise it easily. Writing this, I am currently making a notification badge that will rotate around X axis twice before it settles. see how weird customisation can be?
@MhAllan Syncfusion's SfTabview is a good example how it can be done more dynamic.
Thanks, but who wants to take a look at a leech's work that is being sold for thousands of dollars when operating systems, programming languages, and awesome frameworks are free.
I didnt mean that use Syncfusion. it was just to say that it is good example to see and inspire how they did it. Beside that they offer free for individual customers only paid for big companies over 1m revenue. Believe me they are 1-2 steps ahead of Xamarin itself. we cant even get a proper Collection/ListView here for months, for years.
I agree that the TabViewItem as a whole should more or less just have a ContentView where we can put whatever view we want inside the tab items. The current of doing it, limits us to implementing tab views in the way that you envisioned them, not how we want them. If you want an "easy-to-use" tab view which has a default look, you can just make a SimpleTabItemView
class, which people can use as the view for their tab items, while allowing us to implement our own look and feel via our own custom views.
I agree that the TabViewItem as a whole should more or less just have a ContentView where we can put whatever view we want inside the tab items. The current of doing it, limits us to implementing tab views in the way that you envisioned them, not how we want them. If you want an "easy-to-use" tab view which has a default look, you can just make a
SimpleTabItemView
class, which people can use as the view for their tab items, while allowing us to implement our own look and feel via our own custom views.
I think it is good to have some limitations for stable operation
I think it is good to have some limitations for stable operation
You can still have the default tab view for your easy to use "stable operation". There's no reason to limit the whole view.
These are moving to Xamarin Community Toolkit for now
Silly questions but can we tell the tabs to open new pages or will that still be handled in shell
TabView
We can have tabs using Shell. However, what happens if we want to have nested tabs within a specific section (Example: Grid)?, what if we want to fully customize each tab?. In these cases, we would need a Custom Renderer so far...
The TabView is a way to display a set of tabs and their respective content. TabView is useful for displaying several content while giving a user the capability to customize mostly everything.
NOTE: TabView is a cross-platform view that takes over when native tabs hit their limits, such as positioning with layouts, styling, and non-uniform styling like a raised button.
API
Next, a list with the TabView properties, events and visualstates.
Properties
TabView Properties
TabViewItem Properties
Events
TabView Events
TabViewItem Events
VisualStates
The Visual State Manager (VSM) provides a structured way to make visual changes to the user interface from code. The VSM introduces the concept of visual states. TabView can have several different visual appearances depending on its underlying state.
TabView have four specific VisualStates:
Scenarios
Let's see some samples covering common scenarios.
Basic Tabs
Let's see a basic example:
TabItemsSource
Using TabItemsSource (dynamic tabs):
Custom Tabs
The appearance of each tab can be customized:
Cyclical Tabs
Do you want to navigate between the tabs cyclically?
Lazy Loading
Lazy tab loading:
Tab Transitions and TabViewItem animations
Can use Xamarin.Forms animations to customize the transition between each tab, animate the tab when appears or disappears, or even animate the badge when appears or disappears.
Using VisualStates
Can use different visual states to customize the current tab, the next tab, etc.
Create Tabs using C
You can use XAML or C# to create the UI in Xamarin.Forms. Let's see how we would create tabs using C#.
Using Styles
Can customize the appearance of the tab content, tab strip, tab item, etc. using XAML styles or CSS.
Using XAML:
Using CSS:
Difficulty : Medium
More information
Based on https://github.com/xamarin/Xamarin.Forms/issues/10773