Gets/sets width of a view.
= 0]
0.1
Gets/sets height of a view.
= 0]
0.1
Gets/sets the number of rows that will be shown in a ListView. You should update this property after each data operation.
= 0]
0.1
Gets/sets height of a row in a ListView. Once you created the ListView, you can't change row height. If you want to change height of row dynamically, use onRowHeight callback instead.
0.1
Gets/sets the visibility of vertical scroll bar of ListView. If set to true, scroll bar will be shown otherwise scroll bar will be hidden.
= false]
0.1
If the value of this property is YES , scrolling is enabled, and if it is NO , scrolling is disabled. The default is YES.
= true]
3.2.0
Enables/disables the refresh function of ListView. If set to false onPullRefresh events will not be called.
= true]
0.1
Enables/disables drag & drop behavior. When rowMoveEnabled property is true, onRowSelected callback is not triggered for iOS.
= false]
4.1.4
When UI.ListView#rowMoveEnabled rowMoveEnabled is true, default value is true but you may want to disable this if you want to start dragging on a custom view touch using UI.ListView#startDrag startDrag.
= false]
4.1.4
Enables the swiping behavior. For iOS, this property changes leftToRightSwipeEnabled and rightToLeftSwipeEnabled properties.
= false]
4.1.4
Readonly
contentGets contentOffset of the ListView.
return.x
return.y
3.1.3
Readonly
x: numberReadonly
y: numberGets/Sets contentInset of the ListView.
= {top: 0,bottom: 0}]
3.0.2
Gets/sets the transitionId to be used for transitionViews. See transitionViews for more information
0.1
Gets/sets whether the view is an accessibility element that an assistive app can access.
UI.View
4.3.2
A content description briefly describes the view. VoiceOver will read this string when a user selects the associated element.
UI.View
4.3.2
Defines the opacity of a view. The value of this property is a float number between 0.0 and 1.0. 0 represents view is completely transparent and 1 represents view is completely opaque.
= 1]
UI.View
0.1
Gets/sets background color of a view. It allows setting background color with UI.Color instance.
= UI.Color.WHITE]
UI.View
0.1
Sets/gets border color of bounded view.
= UI.Color.BLACK]
0.1
Sets/gets border thickness of bounded view. Accepts unsigned numbers, 0 means no border.
= 0]
0.1
Sets/gets corner radius of a view. BorderRadius maximum value must be half of the shortest edge.
= 0]
0.1
Sets/gets top-left corner radius of a view.
= 0]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderTopLeftRadius is available on Android.
Sets/gets top-right corner radius of a view.
= 0]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderTopRightRadius is available on Android.
Sets/gets top-start corner radius of a view.
= -1]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderTopStartRadius is available on Android.
Sets/gets top-end corner radius of a view.
= -1]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderTopEndRadius is available on Android.
Sets/gets bottom-left corner radius of a view.
= 0]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderBottomLeftRadius is available on Android.
Sets/gets bottom-right corner radius of a view.
= 0]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderBottomRightRadius is available on Android.
Sets/gets bottom-start corner radius of a view.
= -1]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderBottomStartRadius is available on Android.
Sets/gets bottom-end corner radius of a view.
= -1]
5.0.3
since 5.1.1 Use the borderRadiusEdges property instead. Also android.borderBottomEndRadius is available on Android.
Gets/sets id of a view. It should be unique number for each object inside page. Id will be generated unique by default.
UI.View
0.1
Gets/sets test id for view. resource-id for android; accessibilityIdentifier for iOS.
UI.View
4.3.2
Gets/sets visibility of view. It is set to true as default.
= true]
UI.View
0.1
Gets/sets the degrees that the view is rotated around the pivot point.
= 0]
UI.View
1.1.10
Gets/sets the degrees that the view is rotated around the horizontal axis through the pivot point. RotationX works different for iOS and Android. Android gives perpective to the view but iOS doesn't. This will cause difference on user interface.
= 0]
UI.View
1.1.10
Gets/sets the degrees that the view is rotated around the vertical axis through the pivot point. RotationY works different for iOS and Android. Android gives perpective to the view but iOS doesn't. This will cause difference on user interface.
= 0]
UI.View
1.1.10
Enables/disables touches to view. When set to false events related to touches won't fire. It is set to true as default.
= true]
UI.View
0.1
Gets/sets left position of a view relative to its parent.
= 0]
0.1
Gets/sets top position of a view relative to its parent.
= 0]
0.1
Gets/sets right position of a view relative to its parent. This property works only if view's positionType is UI.FlexLayout.PositionType.ABSOLUTE.
= 0]
0.1
Gets/sets bottom position of a view relative to its parent. This property works only if view's positionType is UI.FlexLayout.PositionType.ABSOLUTE.
= 0]
0.1
Gets/sets minimum width of a view.
= 0]
0.1
Gets/sets minimum height of a view.
= 0]
0.1
Gets/sets maximum width of a view.
= 0]
0.1
Gets/sets maximum height of a view.
= 0]
0.1
Gets/Sets the padding space on the top side of a view.
= 0]
0.1
Gets/Sets the padding space on the bottom side of a view.
= 0]
0.1
Gets/Sets the padding space on the left side of a view.
= 0]
0.1
Gets/Sets the padding space on the right side of a view.
= 0]
0.1
Gets/Sets the padding space on the all sides of a view.
= 0]
0.1
Gets/Sets the margin space on the top side of a view.
= 0]
0.1
Gets/Sets the margin space on the bottom side of a view.
= 0]
0.1
Gets/Sets the margin space on the left side of a view.
= 0]
0.1
Gets/Sets the margin space required on the right side of a view.
= 0]
0.1
Gets/Sets the margin space required on the all sides of a view.
= 0]
0.1
This property specifies the type of positioning method used for a view. To position a view relative to its parent with top,left,right and bottom properties you must set the position type to absolute.
= UI.FlexLayout.PositionType.RELATIVE]
0.1
This property specifies how much a view will grow relative to the other views inside the same UI.FlexLayout FlexLayout.
= 0]
0.1
AspectRatio keeps the ratio between the width and the height of a view. AspectRatio has higher priority than UI.View#flexGrow flexGrow.
0.1
This property specifies how much a view will shrink relative to the other views inside the same UI.FlexLayout FlexLayout.
= 1]
0.1
This property specifies the initial length of a view in a UI.FlexLayout FlexLayout.
= -1]
0.1
This property sets the amount that the view is scaled in X & Y around the pivot point, as a proportion of the view's unscaled width. A value of 1 means that no scaling is applied. Actually UI.flipVertically flipVertically & UI.flipHorizontally flipHorizontally functions are assignes -1 to X & Y to mirror the view. So while using scale, need to consider these functions.
4.0.1
This property specifies how a child view aligns in the cross-axis. It overrides the UI.FlexLayout.AlignItems FlexLayout.AlignItems property of the parent.
= UI.FlexLayout.AlignSelf.AUTO]
0.1
A Boolean indicating whether sublayers are clipped to the layer’s bounds. Android sublayers still overlaps the border's width and as known issue,if UI.View#maskedBorders maskedBorders is used then sublayer won't be clipped.
= true]
4.1.4
A Boolean indicating whether sublayers are clipped to the layer’s bounds. Android sublayers still overlaps the border's width and as known issue,if UI.View#borderRadiusEdges borderRadiusEdges is used then sublayer won't be clipped.
= {topLeft: true, topRight: true, bottomLeft: true, bottomRight: true}]
5.1.1
Specified enums indicates that which corner of View will have radius.
= [View.Border.TOP_LEFT, View.Border.TOP_RIGHT, View.Border.BOTTOM_RIGHT, View.Border.BOTTOM_LEFT]]
4.1.4
since 5.0.3 Use the borderRadiusEdges properties instead.
The color of the shadow. UI.View.ios#masksToBounds property must be false for shadow on iOS. On Android, this property only works on Android 9 and above.
= UI.Color.BLACK]
5.0.3
Readonly
uniqueThis method is deprecated in favor of EventEmitter. You could get more details for the deprecated events from here https://docs.smartface.io/smartface-native-framework/tips-and-tricks/handling-events
import View from '@smartface/native/ui/view';
import FlexLayout from '@smartface/native/ui/flexlayout';
import Button from '@smartface/native/ui/button';
this.view1.on(View.Events.TouchMoved, (point) => {
console.info('view onTouchMoved', point);
});
this.flexLayout1.on(FlexLayout.Events.TouchMoved, (point) => {
console.info('flexLayout onTouchMoved', point);
});
this.button1.on(Button.Events.TouchMoved, (point) => {
console.info('button onTouchMoved', point);
});
Optional
point: Point2DThis event is called before onRowCreate callback. Returns item type you should use based on position.
onRowType
3.0.2
Optional
index: numberThis event is called when a ListView starts to create a ListViewItem. You can customize your UI(not data-binding) inside this callback.
onRowCreate
0.1
Optional
type: numberThis event is called when a ListView starts to create a ListViewItem. You can set different height to rows. If row Height property is assigned, this callback doesn't fire
1.1.18
Optional
index: numberonRowHeight
This event is called when a UI.ListViewItem created at specified row index. You can bind your data to row items inside this callback.
0.1
onRowBind
This event is called when user selects a row at specific index.
0.1
onRowSelected
This event is called when a ListView is scrolling. To remove this evet, set null. For better performance, don't set any callback if does not necessary
onScroll
0.1
This event is called when user pulls down and releases a ListView when scroll position is on the top.
onPullRefresh
0.1
This event is called when dragged item reordered in the list view.
4.1.4
onRowMoved
This event is called when ListViewItem about to swipe. For iOS, this callback is triggered twice consecutively.
myListView.onRowSwipe = function (e) {
if (e.direction == ListView.SwipeDirection.LEFTTORIGHT) {
e.ios.expansionSettings.buttonIndex = -1;
var archiveItem = new ListView.SwipeItem();
archiveItem.text = "ARCHIVE " + e.index;
archiveItem.backgroundColor = Color.GREEN;
archiveItem.textColor = Color.BLACK;
archiveItem.font = Font.create("Arial-ItalicMT", 8);
archiveItem.ios.padding = 40;
archiveItem.ios.isAutoHide = false;
archiveItem.onPress = function (e) {
console.log("Archive : " + e.index);
};
return [archiveItem];
}
else if (e.direction == ListView.SwipeDirection.RIGHTTOLEFT) {
e.ios.expansionSettings.buttonIndex = 0;
e.ios.expansionSettings.threshold = 1.5;
var deleteItem = new ListView.SwipeItem();
deleteItem.text = "DELETE " + e.index;
deleteItem.backgroundColor = Color.RED;
deleteItem.textColor = Color.YELLOW;
deleteItem.icon = Image.createFromFile("images://smartface.png");
deleteItem.ios.iconTextSpacing = 10;
deleteItem.onPress = function (e) {
console.log("Delete Index : " + e.index);
};
var moreItem = new ListView.SwipeItem();
moreItem.text = "MORE";
moreItem.onPress = function (e) {
console.log("More : " + e.index);
};
return [deleteItem, moreItem];
}
}
Return set of swipe items. Android always just consider first index.
4.1.4
This event is called when dragged item before reordered in the list view.
Return true if source index can be reordered by destination index.
4.1.4
onRowMove
By default all the items are draggable if UI.ListView#rowMoveEnabled rowMoveEnabled is true, to restrict some rows set this method and change return value by specific condition.
Return true if index can be draggable
4.1.4
onRowCanMove
By default all the items are swipeable if UI.ListView#swipeEnabled swipeEnabled is true, to restrict some rows set this method and change return value by specific condition. For iOS, this callback is triggered twice consecutively.
Return allowed swipe direction in array.
4.1.4
onRowCanSwipe
This event is called when a touch screen motion event starts.
onTouch
This method is deprecated in favor of EventEmitter. You could get more details for the deprecated events from here https://docs.smartface.io/smartface-native-framework/tips-and-tricks/handling-events
True if the listener has consumed the event, false otherwise.
UI.View
0.1
import View from '@smartface/native/ui/view';
import FlexLayout from '@smartface/native/ui/flexlayout';
import Button from '@smartface/native/ui/button';
this.view1.on(View.Events.Touch, (point) => {
console.info('view onTouch', point);
});
this.flexLayout1.on(FlexLayout.Events.Touch, (point) => {
console.info('flexLayout onTouch', point);
});
this.button1.on(Button.Events.Touch, (point) => {
console.info('button onTouch', point);
});
Optional
e: Point2DThis event is called when a touch screen motion event ends. If touch position inside this view, isInside parameter will be true.
onTouchEnded
This method is deprecated in favor of EventEmitter. You could get more details for the deprecated events from here https://docs.smartface.io/smartface-native-framework/tips-and-tricks/handling-events
True if the listener has consumed the event, false otherwise.
UI.View
0.1
import View from '@smartface/native/ui/view';
import FlexLayout from '@smartface/native/ui/flexlayout';
import Button from '@smartface/native/ui/button';
this.view1.on(View.Events.TouchEnded, (isInside, point) => {
console.info('view onTouchEnded', isInside, point);
});
this.flexLayout1.on(FlexLayout.Events.TouchEnded, (isInside, point) => {
console.info('flexLayout onTouchEnded', isInside, point);
});
this.button1.on(Button.Events.TouchEnded, (isInside, point) => {
console.info('button onTouchEnded', isInside, point);
});
This argument is deprecated. Use motionEvent's property.
This event is called when a parent view takes control of the touch events, like a ListView or ScrollView does when scrolling.
onTouchCancelled
This method is deprecated in favor of EventEmitter. You could get more details for the deprecated events from here https://docs.smartface.io/smartface-native-framework/tips-and-tricks/handling-events
True if the listener has consumed the event, false otherwise.
UI.View
2.0.10
import View from '@smartface/native/ui/view';
import FlexLayout from '@smartface/native/ui/flexlayout';
import Button from '@smartface/native/ui/button';
this.view1.on(View.Events.TouchCancelled, (point) => {
console.info('view onTouchCancelled', point);
});
this.flexLayout1.on(FlexLayout.Events.TouchCancelled, (point) => {
console.info('flexLayout onTouchCancelled', point);
});
this.button1.on(Button.Events.TouchCancelled, (point) => {
console.info('button onTouchCancelled', point);
});
Sets the colors used in the refresh animation. On Android the first color will also be the color of the bar that grows in response to a user swipe gesture. iOS uses only the first color of the array.
setPullRefreshColors
0.1
This method notify the ListView that given range of items deleted. Must set the itemCount value to a changed number before calling this function. For iOS, If you want to make multiple changes (insert, delete, refresh) as a single animation, you should use {UI.ListView#performBatchUpdates performBatchUpdates}.
deleteRowRange
4.1.4
Position of start item
Number of items to be removed from the data set
iOS specific property
This method notify the ListView that given range of items inserted. Must set the itemCount value to a changed number before calling this function. For iOS, If you want to make multiple changes (insert, delete, refresh) as a single animation, you should use {UI.ListView#performBatchUpdates performBatchUpdates}.
insertRowRange
4.1.4
Position of start item
Number of items to be inserted from the data set
iOS specific property
This method notify the ListView that given range of items changed. For iOS, If you want to make multiple changes (insert, delete, refresh) as a single animation, you should use {UI.ListView#performBatchUpdates performBatchUpdates}.
refreshRowRange
4.1.4
Position of start item
Number of items to be changed from the data set
Optional
ios?: { animation: RowAnimation }iOS specific property
Creates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Optional
newState: ScrollStateOptional
contentOffset: Point2DRest
...args: any[]Removes the specified event and invokes the callback after it is removed
Optional
newState: ScrollStateOptional
contentOffset: Point2DRest
...args: any[]Triggers the event manually.
Optional
newState: ScrollStateOptional
contentOffset: Point2DRest
...args: any[]Creates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Optional
newState: ScrollStateOptional
contentOffset: Point2DRest
...args: any[]Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
Optional
newState: ScrollStateOptional
contentOffset: Point2DRest
...args: any[]Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.
Optional
newState: ScrollStateOptional
contentOffset: Point2DRest
...args: any[]Call this when something has changed which has invalidated the layout of this view. This will schedule a layout pass of the view tree. It is useful to call this method when you want to change layout parameters on runtime. If this view layout invalidated, call applyLayout from the Page.layout in the iOS and from the view itself in the Android.
applyLayout
This method returns an object that defines view location on screen. Do not use this method for invisible views in UI.ListView ListView and UI.GridView GridView.
getScreenLocation
location
location.x
location.y
3.2.0
Gets the parent view of a view.
import FlexLayout from '@smartface/native/ui/flexlayout';
import Label from '@smartface/native/ui/label';
var myFlexLayout = new FlexLayout();
myFlexLayout.id = 5432;
var myLabel = new Label({
text: "Smartface Label"
});
myFlexLayout.addChild(myLabel);
var parentId = myLabel.getParent().id; //is equal to 5432.
Parent view of a view, null if not exists.
getParent
0.1
Generated using TypeDoc
Since
0.1
Example