Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14347] BlackBerry : Buttons with width as Ti.UI.SIZE on a view with horizontal layout exits the app on launch

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-07-26T02:45:00.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 13, 2013 Sprint 15 API, 2013 Sprint 15
ComponentsBlackBerry
Labelsqe-3.1.2, qe-nfc, sdk-bb
ReporterLokesh Choudhary
AssigneePedro Enrique
Created2013-06-21T23:38:16.000+0000
Updated2014-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

FileDateSize
SyntaxError.tiff2013-07-26T02:01:38.000+000074404

Comments

  1. Russell McMahon 2013-06-24

    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();
  2. Priya Agarwal 2013-07-19

    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:
       
       var win = Ti.UI.createWindow({});
             
       var view = Ti.UI.createView({
               backgroundColor:'green',
               height:Ti.UI.FILL,
               width:Ti.UI.FILL,
               layout:'horizontal'
                 
       });
        
       var btn1 = Ti.UI.createButton({
               title:'button 1',
               height:30,             
               width:Ti.UI.SIZE
              
       });
                 
       var btn2 = Ti.UI.createButton({
               title:'button 2',
               height:30,
               width:Ti.UI.SIZE     
       });
               
       var btn3 = Ti.UI.createButton({
               title:'button 3',
               height:30,
               width:Ti.UI.SIZE     
       });
       view.add(btn1);
       view.add(bnt2);    
       view.add(btn3);
       win.add(view);
       win.open();
       
    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
  3. Russell McMahon 2013-07-26

    Test the code and recent layout changes have solved the problem.
  4. Russell McMahon 2013-07-26

    oops I was running the above sample code, but on using the test code there is a JavaScript syntax error (see attachment)
  5. Pedro Enrique 2013-07-26

    This seems to have been fixed. Cannot reproduce.
  6. Lokesh Choudhary 2013-08-12

    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

JSON Source