can I covered toolbar with ScrollView? I try it, but It's not work. what problem with my code. thank you
Titanium.UI.setBackgroundColor('#fff'); var win = Titanium.UI.createWindow({ title: 'Tab 1', backgroundColor: '#fff' }); var send = Titanium.UI.createButton({ title: 'Send', style: Titanium.UI.iPhone.SystemButtonStyle.DONE, }); var camera = Titanium.UI.createButton({ systemButton: Titanium.UI.iPhone.SystemButton.CAMERA, }); var cancel = Titanium.UI.createButton({ systemButton: Titanium.UI.iPhone.SystemButton.CANCEL }); var btn = Ti.UI.createButton( { width: 50, height: 40, backgroundImage :'btn11.png', backgroundFocusedImage: 'btn11.png', backgroundSelectedImage: 'btn11.png' } ); flexSpace = Titanium.UI.createButton({ systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE }); var sclView = Titanium.UI.createScrollView( { width:1000, height:40, top:30, left:0, showHorizontalScrollIndicator: true, } ) var toolbar = Titanium.UI.iOS.createToolbar({ items:[send, camera,btn, flexSpace, cancel,btn,btn], bottom:0, borderTop:true, borderBottom:false, top:0 }); sclView.add(toolbar); win.add(sclView); win.open();
1 Answer
Accepted Answer
Hi Chang,
You need to set height,width of toolBar or you need to set contentHeight,contentWidth of scrollview. Try below code.
var toolbar = Titanium.UI.iOS.createToolbar({ items : [send, camera, btn, flexSpace, cancel, btn, btn], borderTop : true, borderBottom : false, top : 0, height : 40, width : 320, left : 0 });
Your Answer
Think you can help? Login to answer this question!