Since

0.1

HeaderBarItem is a button object that can be shown in header bar of a page. Items set to header bar will be shown on the right side of header bar. You can enable/disable items and listen press event.

Example

import UI from '@smartface/native/ui';
var myPage = new UI.Page();
var myItem = new UI.HeaderBarItem({
title: "Smartface",
onPress: function() {
console.log("Smartface item pressed!");
}
});
myPage.headerBar.setItems([myItem]);

Hierarchy

Properties

nativeObject: any
ios: Partial<HeaderBarItemIOSProps>
android: Partial<HeaderBarItemAndroidProps>
title: string

Gets/sets title of header bar item. If image is not set, title will be shown in the header bar.

Title won't show if item is set as left item to header bar.

Property

Android

Ios

Since

0.1

size: undefined | { width: number; height: number }

Gets/sets size of header bar item. Size must be obtained life cycle of page. Otherwise returning value will be undefined.

Property

Property

Property

Android

Ios

Since

4.0.1

image: null | string | IImage<any, MobileOSProps<ImageIOSProps, ImageAndroidProps>>

Gets/sets Image Object or Image Path of header bar item. Image is set to null as default.

If image is already set on HeaderBarItem, title should not be set for some native behaviours.

Property

Android

Ios

Since

0.1

customView: undefined | IView<"touch" | "touchCancelled" | "touchEnded" | "touchMoved", { [key: string]: any }, MobileOSProps<ViewIOSProps, ViewAndroidProps>>

Gets/sets customView of header bar item. Default is undefined. In Android, customView cannot be assigned as UI.HeaderBar#setLeftItem left item. Given customView overrides following HeaderBarItem properties; image, title, font, systemIcon and systemItem.

Property

Android

Ios

Since

4.1.5

enabled: boolean

Gets/sets enabled status of header bar item. Enabled is set to true as default.

Property

Android

Ios

Since

0.1

onPress: null | (() => void)

Gets/sets callback for press event. If enabled property is set to false press callback won't be called.

Property

Android

Ios

Since

0.1

color: null | IColor

Gets/sets color of the item's text/image.

Property

Android

Ios

Since

0.1

badge: IBadge

Gets badge of header bar item. Badge that is displayed in the upper-right corner of the item with a surrounding red oval. Badge should not be given in constructor. In Android, badge does not appear when assigned to UI.HeaderBar#setLeftItem left item of HeaderBar.

Example

var headerBarItem = new HeaderBarItem();
headerBarItem.title = "Item";
headerBarItem.badge.text = "5";
headerBarItem.badge.visible = true;
page.headerBar.setItems([headerBarItem]);

Property

Android

Ios

Since

3.0.0

accessibilityLabel: string

A content description briefly describes the view. VoiceOver will read this string when a user selects the associated element.

Property

Android

Ios

Member

UI.HeaderBarItem

Since

4.4.1

Methods

  • This method returns an object that defines view location on screen.

    Method

    getScreenLocation

    Returns

    location

    Returns

    location.x

    Returns

    location.y

    Android

    Ios

    Since

    3.2.0

    Returns Point2D

Generated using TypeDoc