FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Ability to define a custom view in ActionItem · Issue #1488 · NativeScript/NativeScript · GitHub

Ability to define a custom view in ActionItem #1488

Description

Add ability for ActionItem to have a custom view associated with it, instead of using predefined icon/text. For example something like:

<ActionBar title="Something">
  <ActionBar.actionItems>
    <ActionItem ios.position="right" tap="doneTap">
        <ActionItem.actionView>
            <StackLayout>
                <Label text="Label1" backgroundColor="red"/>
                <Label text="Label2" backgroundColor="green"/>
            </StackLayout>
        </ActionItem.actionView>
    </ActionItem>
  </ActionBar.actionItems>
</ActionBar>

Implementation suggestion:
For iOS - use - (id)initWithCustomView:(UIView *)customView of the UIBarButtonItem. The catch is that in order to be able to handle tap the custom view must be a button. So the custom view must be added as a sub view to a UIButton. And then the UIButton should be passed to the initWithCustomView method.

For Android - use setActionView of MenuItem http://developer.android.com/reference/android/view/MenuItem.html#setActionView(android.view.View)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL