Hi, I have some problem in picker functionality. My problem I'm not able to display the picker value in for android . I'm able to get the rows and title but i'm not able display the text and I wrote the code like this
.xml
<Alloy> <Window id="index" backgroundColor="#EEEEEE"> <View id="dataView_inbox"> <View id="equipment_view" platform="android"> <Picker id="equipment_picker" selectionIndicator="true" useSpinner="false"> </Picker> </View> </View> </Window> </Alloy>.JS
var osname = Ti.Platform.osname; var eq_length = 11; var countryArray = []; var eq_value1 = " "; for (var i = 1; i < eq_length; i++) { // Titanium.API.info("loop country is " + countryList.item(i).text); countryArray[i] =1; eq_value1 += i; Ti.API.info(eq_value1); Ti.API.info(i+"i"); var eq_row = Ti.UI.createPickerRow({ title:"Equipment "+ i, color:"black" }); eq_label = Ti.UI.createLabel({ color:'red', font:{fontSize:20,fontWeight:'bold'}, text: "Equipment "+ i, textAlign:'left', height:'30', width:'126', //top:0, backgroundColor:"red" }); if(osname === 'android') { $.equipment_picker.add(eq_label); $.equipment_picker.add(eq_row); eq_row.title.font = { fontFamily: 'calibri-regular', fontSize: Alloy.CFG.guestfont}; } }; // Equipment_for if(osname === 'android') { // $.equipment_view.add(eq_label); $.equipment_picker.addEventListener('change',function(e) { Ti.API.info("You selected row: "+e.row.title+", column: "+e.column+", custom_item: "+e.row.custom_item); eq_label.text= e.row.title; Ti.API.info("$.eq_label.text:"+eq_label.text); e.row.title.font = { fontFamily: 'calibri-regular', fontSize: Alloy.CFG.guestfont}; //$.equipment_view.add(eq_label); }); } $.index.open();.tss
"#equipment_view":{ left:"0", top:"0", backgroundColor:'black', layout:"vertical" } "#equipment_picker":{ //top:"0", backgroundImage:'/images/dropdown.png', }