[ALOY-983] Popover height and width are ignored when using ContentView element
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-05T18:57:45.000+0000 |
Affected Version/s | Alloy 1.4.0 |
Fix Version/s | Alloy 1.4.0 |
Components | XML |
Labels | qe-testadded |
Reporter | Benjamin Hatfield |
Assignee | Tim Poulsen |
Created | 2014-04-08T20:27:00.000+0000 |
Updated | 2014-06-22T13:21:05.000+0000 |
Description
ENVIRONMENT:
Alloy from master (commit 2267d1d002d7f7bd1f9b61557c11c8d24f259a45/Tue Mar 25 17:31:19 2014 -0400)
Titanium SDK 3.3.0.v20140328110920
Appcelerator Studio, build: 3.3.0.201403281814
Mac OS X 10.8.5
Xcode 5.0.2/iOS 7.0.3/iPad Retina simulator
REPRODUCTION:
Create a new Alloy project and run the code below with the iPad simulator.
RESULTS:
When using the Popover's contentView (ContentView XML element), height and width properties together, the height and width are not respected with Alloy projects. If you do not set the contentView property, the height and width are honored.
Alloy Example
<!-- app/views/index.xml -->
<Alloy>
<Window>
<Button id="button" onClick="openPopover">Show Popover!</Button>
</Window>
</Alloy>
<!-- app/views/popover.xml -->
<Alloy>
<Popover id="popover" height='100' width='250'>
<!-- If you remove the ContentView tags, it works as expected -->
<ContentView>
<View id="popView" backgroundColor='green'>
<Label>Alloy Popover!</Label>
</View>
</ContentView>
</Popover>
</Alloy>
// app/controllers/index.js
function openPopover() {
var popover = Alloy.createController('popover').getView();
popover.show({view:$.button});
};
$.index.open();
Titanium Classic Example -- works as expected
var win = Ti.UI.createWindow();
var button = Ti.UI.createButton({title: 'Show Popover'});
var popView = Ti.UI.createView({
backgroundColor: 'green'
});
var label = Ti.UI.createLabel({text: 'Titanium Popover!'});
popView.add(label);
var popover = Ti.UI.iPad.createPopover({
width: 250,
height: 100,
contentView: popView
});
button.addEventListener('click', function(e){
popover.show({view: button});
});
win.add(button);
win.open();
Attachments
File | Date | Size |
---|---|---|
AlloyPopoverExample.png | 2014-04-08T20:28:00.000+0000 | 54840 |
TitaniumPopoverExample.png | 2014-04-08T20:28:00.000+0000 | 51881 |
PR: https://github.com/appcelerator/alloy/pull/383 Functional test: Run the app included in the PR (https://github.com/skypanther/alloy/tree/ALOY-983/test/apps/testing/ALOY-983) on the iPad simulator or device. There are three buttons. Click on each. They open a popover that uses the ContentView tag containing a View, Window, and NavigationWindow. The height/width of the parent (
PR merged
Verified the fix. The functional test instructions pass. Closing. Environment: Appc Studio : 3.2.3.201404181520 Ti SDK : 3.3.0.v20140508223312 Mac OSX : 10.8.5 Alloy : 1.4.0-dev CLI - 3.3.0-dev Ipad simulator