mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(core): nativescript.config and webpack updates (#8801)
This commit is contained in:
18
apps/ui/src/list-view/width-percent-page.ts
Normal file
18
apps/ui/src/list-view/width-percent-page.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { View } from '@nativescript/core/ui/core/view';
|
||||
import { ListView } from '@nativescript/core/ui/list-view';
|
||||
import { EventData } from '@nativescript/core/data/observable';
|
||||
|
||||
export function onNavigatingTo(args) {
|
||||
const page = args.object;
|
||||
page.bindingContext = ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6'];
|
||||
}
|
||||
|
||||
let scrollToBottom = true;
|
||||
export function onScroll(args: EventData) {
|
||||
let page = (<View>args.object).page;
|
||||
|
||||
let listView = page.getViewById<ListView>('listView');
|
||||
listView.scrollToIndex(scrollToBottom ? listView.items.length - 1 : 0);
|
||||
|
||||
scrollToBottom = !scrollToBottom;
|
||||
}
|
||||
Reference in New Issue
Block a user