Files
NativeScript/e2e/ui-tests-app/app/tab-view/tab-view-icon-change-page.ts
2019-06-25 16:52:01 +03:00

16 lines
458 B
TypeScript

import { TabView, SelectedIndexChangedEventData } from "tns-core-modules/ui/tab-view";
export function onSelectedIndexChanged(args: SelectedIndexChangedEventData) {
const tabView = args.object as TabView;
const newItem = tabView.items[args.newIndex];
if (newItem) {
newItem.iconSource = "res://icon";
}
const oldItem = tabView.items[args.oldIndex];
if (oldItem) {
oldItem.iconSource = "res://testlogo";
}
}