mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
TabEntry renamed to TabViewItem
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
|
||||
<TabView>
|
||||
<TabView.items>
|
||||
<TabEntry title="List">
|
||||
<TabEntry.view>
|
||||
<TabViewItem title="List">
|
||||
<TabViewItem.view>
|
||||
<ListView items="{{ redditItems }}" isScrolling="{{ isScrolling }}" itemTap="listViewItemTap" loadMoreItems="listViewLoadMoreItems">
|
||||
<ListView.itemTemplate>
|
||||
<!-- Binding in template property of an component will use the bindingContext provided by the component. -->
|
||||
@@ -15,16 +15,16 @@
|
||||
<!-- End of tempplate. -->
|
||||
</ListView.itemTemplate>
|
||||
</ListView>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
<TabEntry title="About">
|
||||
<TabEntry.view>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="About">
|
||||
<TabViewItem.view>
|
||||
<StackLayout>
|
||||
<Image margin="10" url="~/app/res/telerik-logo.png" />
|
||||
<Label margin="10" textWrap="true" text="{{ aboutText }}" />
|
||||
</StackLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
</TabView.items>
|
||||
</TabView>
|
||||
</Page>
|
||||
@@ -2,20 +2,20 @@
|
||||
<Page>
|
||||
<TabView>
|
||||
<TabView.items>
|
||||
<TabEntry title="First">
|
||||
<TabEntry.view>
|
||||
<TabViewItem title="First">
|
||||
<TabViewItem.view>
|
||||
<GridLayout>
|
||||
<Label text="First Tab" verticalAlignment="center" horizontalAlignment="center"/>
|
||||
</GridLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
<TabEntry title="Second">
|
||||
<TabEntry.view>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Second">
|
||||
<TabViewItem.view>
|
||||
<GridLayout>
|
||||
<Label text="Second Tab" verticalAlignment="center" horizontalAlignment="center"/>
|
||||
</GridLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
</TabView.items>
|
||||
</TabView>
|
||||
</Page>
|
||||
@@ -1,22 +1,22 @@
|
||||
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
|
||||
<TabView>
|
||||
<TabView.items>
|
||||
<TabEntry title="First">
|
||||
<TabEntry.view>
|
||||
<TabViewItem title="First">
|
||||
<TabViewItem.view>
|
||||
<StackLayout cssClass="tab-content">
|
||||
<Label text="First View" cssClass="title"/>
|
||||
<Label text="This is the content of the first tab." textWrap="true"/>
|
||||
</StackLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
<TabEntry title="Second">
|
||||
<TabEntry.view>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Second">
|
||||
<TabViewItem.view>
|
||||
<StackLayout cssClass="tab-content">
|
||||
<Label text="Second View" cssClass="title"/>
|
||||
<Label text="This is the content of the second tab." textWrap="true"/>
|
||||
</StackLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
</TabView.items>
|
||||
</TabView>
|
||||
</Page>
|
||||
@@ -17,16 +17,16 @@ import buttonModule = require("ui/button");
|
||||
// <Page>
|
||||
// <TabView>
|
||||
// <TabView.items>
|
||||
// <TabEntry title="Tab 1">
|
||||
// <TabEntry.view>
|
||||
// <TabViewItem title="Tab 1">
|
||||
// <TabViewItem.view>
|
||||
// <Label text="Label in Tab1" />
|
||||
// </TabEntry.view>
|
||||
// </TabEntry>
|
||||
// <TabEntry title="Tab 2">
|
||||
// <TabEntry.view>
|
||||
// </TabViewItem.view>
|
||||
// </TabViewItem>
|
||||
// <TabViewItem title="Tab 2">
|
||||
// <TabViewItem.view>
|
||||
// <Label text="Label in Tab2" />
|
||||
// </TabEntry.view>
|
||||
// </TabEntry>
|
||||
// </TabViewItem.view>
|
||||
// </TabViewItem>
|
||||
// </TabView.items>
|
||||
// </TabView>
|
||||
// </Page>
|
||||
@@ -47,8 +47,8 @@ function _createTabView(): tabViewModule.TabView {
|
||||
return tabView;
|
||||
}
|
||||
|
||||
function _createItems(count: number): Array<tabViewModule.TabEntry> {
|
||||
var items = new Array<tabViewModule.TabEntry>();
|
||||
function _createItems(count: number): Array<tabViewModule.TabViewItem> {
|
||||
var items = new Array<tabViewModule.TabViewItem>();
|
||||
for (var i = 0; i < count; i++) {
|
||||
var label = new labelModule.Label();
|
||||
label.text = "Tab " + i;
|
||||
@@ -263,7 +263,7 @@ export var testBindingToTabEntryWithUndefinedViewShouldThrow = function () {
|
||||
var tabView = <tabViewModule.TabView>views[0];
|
||||
TKUnit.assertThrows(function () {
|
||||
tabView.items = [{ title: "Tab 0", view: undefined }];
|
||||
}, "Binding TabView to a TabEntry with undefined view should throw.");
|
||||
}, "Binding TabView to a TabViewItem with undefined view should throw.");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ export var testBindingToTabEntryWithNullViewShouldThrow = function () {
|
||||
var tabView = <tabViewModule.TabView>views[0];
|
||||
TKUnit.assertThrows(function () {
|
||||
tabView.items = [{ title: "Tab 0", view: null }];
|
||||
}, "Binding TabView to a TabEntry with null view should throw.");
|
||||
}, "Binding TabView to a TabViewItem with null view should throw.");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
xmlns:customControls2="app/xml-declaration/mymodulewithxml">
|
||||
<TabView>
|
||||
<TabView.items>
|
||||
<TabEntry title="Tab 1">
|
||||
<TabEntry.view>
|
||||
<TabViewItem title="Tab 1">
|
||||
<TabViewItem.view>
|
||||
<StackLayout>
|
||||
|
||||
<SegmentedBar selectedIndex="1" style="background-color: red; color: white" selectedBackgroundColor="green">
|
||||
@@ -38,25 +38,25 @@
|
||||
<Button text="This is Button!" tap="buttonTap" />
|
||||
<customControls:MyControl />
|
||||
</StackLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
<TabEntry title="Tab 2">
|
||||
<TabEntry.view>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Tab 2">
|
||||
<TabViewItem.view>
|
||||
<StackLayout>
|
||||
<customControls2:MyControl />
|
||||
<Label text="This is Label in Tab 2" />
|
||||
</StackLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
<TabEntry title="Tab 3">
|
||||
<TabEntry.view>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
<TabViewItem title="Tab 3">
|
||||
<TabViewItem.view>
|
||||
<GridLayout columns="50, auto, *" rows="50, auto, *">
|
||||
<Label text="This is Label in Tab 3" row="0" />
|
||||
<Label text="This is second Label in Tab 3" row="1" />
|
||||
<customControls:MyControl />
|
||||
</GridLayout>
|
||||
</TabEntry.view>
|
||||
</TabEntry>
|
||||
</TabViewItem.view>
|
||||
</TabViewItem>
|
||||
</TabView.items>
|
||||
</TabView>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user