如何从在喷丝项目的列表删除所述特定选择的项目 [英] how to delete the particular selected item from the list of items in spinner

查看:103
本文介绍了如何从在喷丝项目的列表删除所述特定选择的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跟着 http://www.designerandroid.com/?p=8 这一到,而我们选择清除微调项整体事件将被删除添加在spinner.In它的值。但我需要选择特定项目只想delete.Any人能帮助我..样品code将有助于我很多东西。

I followed http://www.designerandroid.com/?p=8 this one to add the values in the spinner.In it while we select the "clear spinner items" the whole events are will be delete. But i need to the selected particular item only want to delete.Any one can help me.. The sample code will help to me lot.

推荐答案

要从微调删除特定的项目,你必须从arrayadapter这是您使用的填充它删除它。

To delete particular item from spinner you have to remove it from arrayadapter which is you using for filling it.

所以首先得到你想要ř删除项目的位置。

不是获取对象FRM从mehod其位置arrayadapter。

than get the object frm arrayadapter from its position by mehod.

int pos = 0;object t=m_adapterForSpinner.getitem(pos);//whr m_arrayadapter is array adapter using for filling spinner


和比微调用以下code删除:


and than remove it from spinner by using following code:

m_adapterForSpinner.remove((CharSequence) t);


比arrayadapter再次填写乌尔微调。


than fill ur spinner again with arrayadapter.

这篇关于如何从在喷丝项目的列表删除所述特定选择的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆