mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
CenterView renamed to TitleView
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<Page loaded="pageLoaded">
|
||||
<Page.actionBar>
|
||||
<ActionBar title="Title">
|
||||
<ActionBar.centerView>
|
||||
<ActionBar.titleView>
|
||||
<SegmentedBar selectedIndex="{{ index }}">
|
||||
<SegmentedBar.items>
|
||||
<SegmentedBarItem title="Item 1" />
|
||||
@ -9,7 +9,7 @@
|
||||
<SegmentedBarItem title="Item 3" />
|
||||
</SegmentedBar.items>
|
||||
</SegmentedBar>
|
||||
</ActionBar.centerView>
|
||||
</ActionBar.titleView>
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
<StackLayout>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<Page loaded="pageLoaded">
|
||||
<Page.actionBar>
|
||||
<ActionBar title="Title">
|
||||
<ActionBar.centerView>
|
||||
<StackLayout orientation="horizontal" verticalAlignment="center" horizontalAlignment="center">
|
||||
<ActionBar.titleView>
|
||||
<StackLayout orientation="horizontal">
|
||||
<Button text="1st" />
|
||||
<Button text="2nd" />
|
||||
<Button text="3rd" />
|
||||
</StackLayout>
|
||||
</ActionBar.centerView>
|
||||
</ActionBar.titleView>
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
<StackLayout>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<Page loaded="pageLoaded">
|
||||
<Page.actionBar>
|
||||
<ActionBar title="Title">
|
||||
<ActionBar.centerView>
|
||||
<ActionBar.titleView>
|
||||
<Button text="{{ centerText }}" tap="{{ centerTap }}" />
|
||||
</ActionBar.centerView>
|
||||
</ActionBar.titleView>
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
<StackLayout>
|
||||
|
@ -50,7 +50,7 @@ export function test_actionBar_inherit_bindingContext_inXML() {
|
||||
export function test_actionItem_inherit_bindingContext_inXML() {
|
||||
var p = <PageModule.Page>builder.parse(
|
||||
"<Page> <Page.actionBar> <ActionBar> <ActionBar.actionItems>" +
|
||||
"<ActionItem text=\"{{ myProp }} \" />" +
|
||||
"<ActionItem text=\"{{ myProp }} \" />" +
|
||||
"</ActionBar.actionItems> </ActionBar> </Page.actionBar> </Page>");
|
||||
p.bindingContext = { myProp: "success" };
|
||||
|
||||
@ -70,35 +70,35 @@ export function test_navigationButton_inherit_bindingContext_inXML() {
|
||||
TKUnit.assertEqual(navButton.text, "success", "actionItem.text");
|
||||
};
|
||||
|
||||
export function test_centerView_inherit_bindingContext_inXML() {
|
||||
export function test_titleView_inherit_bindingContext_inXML() {
|
||||
var p = <PageModule.Page>builder.parse(
|
||||
"<Page> <Page.actionBar> <ActionBar> <ActionBar.centerView>" +
|
||||
"<Page> <Page.actionBar> <ActionBar> <ActionBar.titleView>" +
|
||||
"<Button text=\"{{ myProp }} \" />" +
|
||||
"</ActionBar.centerView> </ActionBar> </Page.actionBar> </Page>");
|
||||
"</ActionBar.titleView> </ActionBar> </Page.actionBar> </Page>");
|
||||
p.bindingContext = { myProp: "success" };
|
||||
|
||||
var centerBtn = <button.Button>p.actionBar.centerView;
|
||||
var centerBtn = <button.Button>p.actionBar.titleView;
|
||||
TKUnit.assert(centerBtn instanceof button.Button, "cneterView not loaded correctly");
|
||||
TKUnit.assertEqual(centerBtn.text, "success", "actionItem.text");
|
||||
};
|
||||
|
||||
export function test_centerView_inXML() {
|
||||
export function test_titleView_inXML() {
|
||||
var p = <PageModule.Page>builder.parse(
|
||||
"<Page> <Page.actionBar> <ActionBar> <ActionBar.centerView>" +
|
||||
"<Page> <Page.actionBar> <ActionBar> <ActionBar.titleView>" +
|
||||
"<Button/>" +
|
||||
"</ActionBar.centerView> </ActionBar> </Page.actionBar> </Page>");
|
||||
"</ActionBar.titleView> </ActionBar> </Page.actionBar> </Page>");
|
||||
|
||||
var centerBtn = <button.Button>p.actionBar.centerView;
|
||||
var centerBtn = <button.Button>p.actionBar.titleView;
|
||||
TKUnit.assert(centerBtn instanceof button.Button, "cneterView not loaded correctly");
|
||||
};
|
||||
|
||||
export function test_centerView_inXML_short_definition() {
|
||||
export function test_titleView_inXML_short_definition() {
|
||||
var p = <PageModule.Page>builder.parse(
|
||||
"<Page> <Page.actionBar> <ActionBar>" +
|
||||
"<Button/>" +
|
||||
"</ActionBar> </Page.actionBar> </Page>");
|
||||
|
||||
var centerBtn = <button.Button>p.actionBar.centerView;
|
||||
var centerBtn = <button.Button>p.actionBar.titleView;
|
||||
TKUnit.assert(centerBtn instanceof button.Button, "cneterView not loaded correctly");
|
||||
};
|
||||
|
||||
|
@ -127,18 +127,18 @@ export var test_event_LoadedUnloaded_IsRaised = function () {
|
||||
var layoutUnloaded = false,
|
||||
buttonUnloaded = false;
|
||||
|
||||
views[1].on(viewModule.View.unloadedEvent,(data) => {
|
||||
views[1].on(viewModule.View.unloadedEvent, (data) => {
|
||||
layoutUnloaded = true;
|
||||
});
|
||||
|
||||
views[2].on(viewModule.View.unloadedEvent,(data) => {
|
||||
views[2].on(viewModule.View.unloadedEvent, (data) => {
|
||||
buttonUnloaded = true;
|
||||
});
|
||||
|
||||
var newButton = new button.Button(),
|
||||
buttonLoaded = false;
|
||||
|
||||
newButton.on(viewModule.View.loadedEvent,(data) => {
|
||||
newButton.on(viewModule.View.loadedEvent, (data) => {
|
||||
buttonLoaded = true;
|
||||
});
|
||||
|
||||
@ -598,7 +598,7 @@ function _createLabelWithBorder(): viewModule.View {
|
||||
|
||||
export var testIsVisible = function () {
|
||||
var lbl = new label.Label();
|
||||
|
||||
|
||||
helper.buildUIAndRunTest(lbl, function (views: Array<viewModule.View>) {
|
||||
TKUnit.assert(lbl.visibility === enums.Visibility.visible, "Actual: " + lbl.visibility + "; Expected: " + enums.Visibility.visible);
|
||||
TKUnit.assert(lbl._isVisible, "Actual: " + lbl._isVisible + "; Expected: true;");
|
||||
|
Reference in New Issue
Block a user