Button

Button example

Button without content

Button with text example

Button with TextView as a content

It's a custom view based on ListLayout and receives input focus, has content that is automatically centered by default. This makes it convenient for creating interactive buttons or components with clickable areas

Create from source

func NewButton(session Session, params Params) Button

Create new button object and returns its interface

Create from resource

Button {
    id = button,
    content = [],
}

Interface description

Inherit methods, properties and events from CustomView

func ButtonByID(rootView View, id string, ids ...string) Button

Returns the child Button, path to which is specified using the arguments id, ids. Example: view := ButtonByID(rootView, "id1", "id2", "id3"), view := ButtonByID(rootView, "id1/id2/id3"). These two function calls are equivalent. If a View with this path is not found or View is not Button, the function will return nil.