[TIMOB-14347] BlackBerry : Buttons with width as Ti.UI.SIZE on a view with horizontal layout exits the app on launch
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-07-26T02:45:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 13, 2013 Sprint 15 API, 2013 Sprint 15 |
Components | BlackBerry |
Labels | qe-3.1.2, qe-nfc, sdk-bb |
Reporter | Lokesh Choudhary |
Assignee | Pedro Enrique |
Created | 2013-06-21T23:38:16.000+0000 |
Updated | 2014-06-19T12:44:27.000+0000 |
Description
Note: This issue is seen only for buttons. Views & Labels work fine
Description:
==============
1. Create an app with the following code:
FOR BUTTON:
================
var win = Ti.UI.createWindow({});
var view = Ti.UI.createView({
backgroundColor:'green',
height:200,
width:200,
layout:'horizontal'
});
win.add(view);
var v1 = Ti.UI.createButton({
//backgroundColor:'blue',
title:'button 1',
height:30,
left:5,
width:Ti.UI.SIZE,
top:80
});
view.add(v1);
var v2 = Ti.UI.createButton({
//backgroundColor:'red',
title:'button 2',
height:30,
left:5,
width:Ti.UI.SIZE,
top:80
});
view.add(v2);
var v3 = Ti.UI.createButton({
//backgroundColor:'black',
title:'button 1',
height:30,
left:5,
width:Ti.UI.SIZE,
top:80
});
view.add(v3);
win.open();
2. Build & run for BB device/simulator
3. Observe after app launches
Actual Result:
===============
1. The app exits immediately after launch
Expected Result:
=================
1. The app should run & we should see the views & buttons in horizontal layout
Attachments
File | Date | Size |
---|---|---|
SyntaxError.tiff | 2013-07-26T02:01:38.000+0000 | 74404 |
Test to see the horizontal layout move control to next line: var win = Ti.UI.createWindow({}); var view = Ti.UI.createView({ backgroundColor:'green', // height:200, width:200, layout:'horizontal' }); win.add(view); var v1 = Ti.UI.createButton({ //backgroundColor:'blue', title:'button 1', //height:30, left:5, width:Ti.UI.SIZE, top:80 }); view.add(v1); var v2 = Ti.UI.createButton({ //backgroundColor:'red', title:'button 2', //height:30, left:5, width:Ti.UI.SIZE, top:80 }); view.add(v2); var v3 = Ti.UI.createButton({ //backgroundColor:'black', title:'button 3', //height:30, left:5, width:Ti.UI.SIZE, top:80 }); view.add(v3); win.open();
Reopening, The app now not crashes but also is not working as expected. Button with Ti.UI.SIZE when used inside view with layout:horizontal only the last button is view on screen. Where as when we restrict width of the button,suppose width:30(button width) inside view with layout horizontal. It works well. Code used is:
In the same code when all the three button's width changed as width:'30' is working fine. Verified with Environment: Studio: 3.1.2.201307171817 Titanium SDK:3.1.2.v20130718094558 acs:1.0.3 alloy:1.1.3 npm:1.3.2 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device:Blackberry-Z10(v 10.0.10.261),ios Simulator(v6.0),Galaxy Nexus(v4.0.4) Xcode: 4.5.1 blackberry SDK: 10.1.0.1020
Test the code and recent layout changes have solved the problem.
oops I was running the above sample code, but on using the test code there is a JavaScript syntax error (see attachment)
This seems to have been fixed. Cannot reproduce.
Verified the fix. The app does not crash & we see the layout of the buttons as expected i.e if they do not fit horizontally it moves to the next line. Environment: Appcel Studio : 3.1.2.201308082014 Ti SDK : 3.1.2.v20130809141556 Mac OSX : 10.8.4 Alloy : 1.2.0-alpha6 CLI - 3.1.2-alpha win 7 Win 8 Z10 BB simulator : 10.0.10.822 Z10 device running 10.0.10.88 Q10 Simulator : 10.1.0.1720 Q10 Dev alpha C device running 10.1.0.138