mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-23 00:52:33 +08:00
16 lines
458 B
TypeScript
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";
|
|
}
|
|
}
|