0

I'm using a picker object inside a simple view, which is one of many contained inside a scrollable view. When I click the picker, the option-list does not display. However, when I hit the back button, and return to the previous page, the list briefly appears then disappears.

var win_list = Titanium.UI.createScrollableView({  
    backgroundColor:'transparent',
    borderWidth:8,
    borderColor:'#888',
    height:550,
    width:330,
    top: 180,
    zIndex:1,
    borderRadius:10,     
showPagingControl:true,
pagingControlHeight:30,
});

    var view2 = Ti.UI.createView({
    left: 0,
    width : "90%",
    height: '100%',
    layout: 'vertical',
    zIndex: 10
   // backgroundColor: 'transparent'     
});  

    var pickerScore = Titanium.UI.createPicker({        
    top: 10,
    left: '50dp',
    height: 'auto',
    width: 125,
    transform: transformPicker,     
});

view2.add(pickerScore);

win_list.addView(view2);

I've realised that if I add view2 to the win_list using win_list.add(view2) instead, the picker behaves as required, but not using .addView(). However, I need to use .addView() to have the pages added properly, is there any solution?

Noel Euzebe
  • 95
  • 2
  • 9

1 Answers1

0

Just try following Code. This is working for me.

var win = Titanium.UI.createWindow({backgroundColor:"#f0f"});

var win_list = Titanium.UI.createScrollableView({  
    backgroundColor:'transparent',
    borderWidth:8,
    borderColor:'#888',
    height:550,
    width:330,
    top: 180,
    zIndex:1,
    borderRadius:10,     
showPagingControl:true,
pagingControlHeight:30,
});

var view2 = Ti.UI.createView({
    left: 0,
    width : "90%",
    height: '100%',
    layout: 'vertical',
    zIndex: 10
});  

var pickerScore = Titanium.UI.createPicker({        
    top: 10,
    height: 'auto',
    type : Ti.UI.PICKER_TYPE_DATE,   
});

view2.add(pickerScore);

win_list.addView(view2);
win.add(win_list);

win.open();

MRT
  • 1,610
  • 15
  • 41
  • Not sure how this works? In Titanium SDK 3.1.3 I'm still struggling to display the picker, on click, nothing pops up. I'm in the same situation where the picker is in a view, which is in a scrollableview. – Yozef Oct 11 '13 at 00:21