[ALOY-984] Support RightNavButtons and LeftNavButtons in Alloy XML Markup
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-06-02T17:46:52.000+0000 |
Affected Version/s | Alloy 1.4.0 |
Fix Version/s | Alloy 1.5.0 |
Components | XML |
Labels | qe-manualtest |
Reporter | Benjamin Hatfield |
Assignee | Tim Poulsen |
Created | 2014-04-09T23:58:12.000+0000 |
Updated | 2016-01-25T17:43:02.000+0000 |
Description
ENVIRONMENT: Alloy from master (commit 2267d1d002d7f7bd1f9b61557c11c8d24f259a45/Tue Mar 25 17:31:19 2014 -0400) Titanium SDK 3.3.0.v20140409153121 Appcelerator Studio, build: 3.3.0.201403281814 Mac OS X 10.8.5 Xcode 5.0.2/iOS 7.0.3/iPad or iPhone Retina simulator DESCRIPTION: Ti SDK 3.3.0 is introducing two new iOS-only properties for a Window object:rightNavButtons
and leftNavButtons
. These accept an array of views.
Just an FYI to see if it would be possible to implement these properties in Alloy XML. See sample below.
YAML Docs:
https://github.com/appcelerator/titanium_mobile/blob/master/apidoc/Titanium/UI/Window.yml#L409-L413
https://github.com/appcelerator/titanium_mobile/blob/master/apidoc/Titanium/UI/Window.yml#L634-L638
SAMPLE XML:
<Alloy>
<NavigationWindow>
<Window>
<LeftNavButtons>
<View width="25" height="25" backgroundColor="red"/>
<View width="25" height="25" backgroundColor="green"/>
<View width="25" height="25" backgroundColor="blue"/>
</LeftNavButtons>
<RightNavButtons>
<Button title="btn 1"/>
<Button title="btn 2"/>
<Button title="btn 3"/>
</RightNavButtons>
</Window>
</NavigationWindow>
</Alloy>
TITANIUM EXAMPLE:
var win = Ti.UI.createWindow();
win.leftNavButtons = [
Ti.UI.createView({backgroundColor: 'red', height: 25, width: 25}),
Ti.UI.createView({backgroundColor: 'green', height: 25, width: 25}),
Ti.UI.createView({backgroundColor: 'blue', height: 25, width: 25}),
];
win.rightNavButtons = [
Ti.UI.createButton({title: 'btn 1'}),
Ti.UI.createButton({title: 'btn 2'}),
Ti.UI.createButton({title: 'btn 3'})
];
var navWin = Ti.UI.iOS.createNavigationWindow({window:win});
navWin.open();
Attachments
File | Date | Size |
---|---|---|
NavButtons.png | 2014-04-09T23:58:12.000+0000 | 17289 |