2012-03-21 12 views
0

ListView内でImageButtonのプロパティを管理するにはどうすればいいですか?イメージを意味し、ボタンを有効または無効にすることはできますか?有効/無効のlistview内のimagebutton

public View getView(int position, View convertView, ViewGroup parent) { 
    View vi=convertView; 
    if(convertView==null) 
     vi = inflater.inflate(R.layout.main, null); 

    TextView title = (TextView)vi.findViewById(R.id.title); 
    TextView retail_price = (TextView)vi.findViewById(R.id.Retail_price); 
    TextView deal_price = (TextView)vi.findViewById(R.id.Deal_price); 
    TextView duration = (TextView)vi.findViewById(R.id.Time); 
    ImageButton imgB = (ImageButton)vi.findViewById(R.id.imageButton1); 
    TextView participants = (TextView)vi.findViewById(R.id.Particpant); 
    ImageView thumb_image=(ImageView)vi.findViewById(R.id.list_image); 

    HashMap<String, String> otherdeals = new HashMap<String, String>(); 
    otherdeals = data.get(position); 

    imgB.setImageResource(R.drawable.boutonachete); 
+0

ここでは正確に同じ質問をしています。http://stackoverflow.com/questions/9795418/conditionally-change- imagebutton-image /あなたが役に立つ反応を得た – 207

答えて

0

、uが意味:imgB.setVisibility(View.VISIBLE)/imgB.setVisibility(View.GONE)? イメージを操作するには、描画可能なものを取り出すことができます。imgB.getDrawable()

関連する問題