开发者

List of Checkboxes in Android App using Flex and Flashbuilder

I am trying to implement a list of checkboxes and a Android Form App I am working on. I want the list to only have single selection, i.e. I can only select one option from the list.... for some reason I c开发者_如何学Goan not find any code to do this, I am using Flashbuilder and the Flex framework, anyone know of a way to do this ??

Thanks in advance for any help!


If you want a single selection, use radio buttons with a radio button group. The only reason you'd want to use checkboxes is if you want to turn off all selections (with radio buttons, once you've clicked a button one is always selected).

If you still want to use checkboxes, do the following:

onCheckBoxSelected(e:Event){

   for each(checkbox:CheckBox in collectionOfCheckBoxes){
     if(checkbox != e.currentTarget){
       checkbox.selected=false;
     }
   }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜