mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Repeater added to gallery app
This commit is contained in:
@ -76,6 +76,9 @@
|
||||
<TypeScriptCompile Include="apps\gallery-app\views\list-view.ts">
|
||||
<DependentUpon>list-view.xml</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="apps\gallery-app\views\repeater.ts">
|
||||
<DependentUpon>repeater.xml</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="apps\placeholder-demo\app.ts" />
|
||||
<TypeScriptCompile Include="apps\placeholder-demo\main-page.android.ts">
|
||||
<DependentUpon>main-page.xml</DependentUpon>
|
||||
@ -597,6 +600,7 @@
|
||||
<Content Include="apps\gallery-app\content\border.xml" />
|
||||
<Content Include="apps\gallery-app\app.css" />
|
||||
<Content Include="apps\gallery-app\views\list-picker.xml" />
|
||||
<Content Include="apps\gallery-app\views\repeater.xml" />
|
||||
<Content Include="apps\gallery-app\views\segmented-bar.xml" />
|
||||
<Content Include="apps\gallery-app\views\time-picker.xml" />
|
||||
<Content Include="apps\gallery-app\views\date-picker.xml" />
|
||||
|
@ -32,6 +32,7 @@
|
||||
<Button tag="views/image" text="Image" tap="itemTap" />
|
||||
<Button tag="views/search-bar" text="SearchBar" tap="itemTap" />
|
||||
<Button tag="views/list-view" text="ListView" tap="itemTap" />
|
||||
<Button tag="views/repeater" text="Repeater" tap="itemTap" />
|
||||
<Button tag="views/dialogs" text="Dialogs" tap="itemTap" />
|
||||
<Button tag="views/date-picker" text="DatePicker" tap="itemTap" />
|
||||
<Button tag="views/time-picker" text="TimePicker" tap="itemTap" />
|
||||
|
10
apps/gallery-app/views/repeater.ts
Normal file
10
apps/gallery-app/views/repeater.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export function pageLoaded(args) {
|
||||
var page = args.object;
|
||||
|
||||
var itemsArr = [];
|
||||
for (var i = 1; i <= 64; i++) {
|
||||
itemsArr.push({ title: "List item " + i });
|
||||
}
|
||||
|
||||
page.bindingContext = { items: itemsArr };
|
||||
}
|
13
apps/gallery-app/views/repeater.xml
Normal file
13
apps/gallery-app/views/repeater.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Page loaded="pageLoaded">
|
||||
<ScrollView>
|
||||
<Repeater items="{{ items }}">
|
||||
<Repeater.itemsLayout>
|
||||
<WrapLayout />
|
||||
</Repeater.itemsLayout>
|
||||
<Repeater.itemTemplate>
|
||||
<Label text="{{ title }}" margin="10" />
|
||||
</Repeater.itemTemplate>
|
||||
</Repeater>
|
||||
</ScrollView>
|
||||
</Page>
|
Reference in New Issue
Block a user