TabFragment

Example

from enamlnative.core.api import *
from enamlnative.widgets.api import *

enamldef ContentView(Flexbox):
    flex_direction = "column"
    ViewPager:
        TabLayout: tab_layout:
            attr placement = 'top'
            gravity << placement
            tab_color = '#7fff'
            tab_color_selected = '#fff'
            background_color = '#3574a3'
        Looper:
            iterable << ['First', 'Second', 'Third']
            TabFragment:
                title = loop_item
                Flexbox:
                    background_color = '#fff'
                    flex_direction = 'column'
                    padding = (10,10,10,10)
                    Spinner:
                        items = ['top', 'bottom']
                        selected << 0 if tab_layout.placement == 'top' else 1
                        selected :: tab_layout.placement = self.items[self.selected]
                    TextView:
                        text = "Tab modes"
                    Spinner:
                        items = ['fixed','scrollable']
                        selected << 0 if tab_layout.tab_mode == 'fixed' else 1
                        selected :: tab_layout.tab_mode = self.items[self.selected]
                    TextView:
                        text = "Tab gravity"
                    Spinner:
                        items = ['fill', 'center']
                        selected << 0 if tab_layout.tab_gravity == 'fill' else 1
                        selected :: tab_layout.tab_gravity = self.items[self.selected]

Declaration

class enamlnative.widgets.tab_layout.TabFragment(parent=None, **kwargs)[source]

Bases: enamlnative.widgets.view_pager.PagerFragment

A TabFragment alias for a PagerFragment

proxy

A reference to the ProxyTabFragment object.

Android Implementation

class enamlnative.android.android_tab_layout.AndroidTabFragment[source]

Bases: enamlnative.android.android_fragment.AndroidPagerFragment, enamlnative.widgets.tab_layout.ProxyTabFragment

This is just an alias for future expansion.

No iOS implementation found.