Toolbar

Screenshot

Toolbar - Reference - Enaml-native - CodeLV

Example

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

# You can use a LinearLayout instead of CoordinatorLayout if you want the
# to disable expanding / contracting altogether
enamldef ContentView(CoordinatorLayout): drawer:
    AppBarLayout: app_bar:
        height = "wrap_content"
        expanded = True
        vertical_offset :: print(self.vertical_offset)
        Toolbar:
            title = "Title"
            subtitle = "Subtitle"
            height = "wrap_content"
    LinearLayout:
        orientation = 'vertical'
        margin << (0, 60 if app_bar.expanded else 0, 0, 0)
        Switch:
            text = "Show app bar"
            checked := app_bar.expanded

Declaration

class enamlnative.widgets.toolbar.Toolbar(parent=None, **kwargs)[source]

Bases: enamlnative.widgets.view_group.ViewGroup

A standard toolbar for use within application content.

content_padding

Sets the content padding

title

Set the title of this toolbar.

subtitle

Set the subtitle of this toolbar

title_margins

Sets the title margin.

title_color

Sets the text color of the title, if present.

subtitle_color

Sets the text color of the subtitle, if present.

proxy

A reference to the ProxyLabel object.

Android Implementation

class enamlnative.android.android_toolbar.AndroidToolbar[source]

Bases: enamlnative.android.android_view_group.AndroidViewGroup, enamlnative.widgets.toolbar.ProxyToolbar

An Android implementation of an Enaml ProxyToolbar.

widget

A reference to the widget created by the proxy.

create_widget()[source]

Create the underlying widget.

No iOS implementation found.