0

Im using an inflater inside an adapter for my listview. I need to add in a different button depending in the state of the data for each row, so Im thinking I need to do this programmatically, but how do I make sure its inserted into the correct place inside the layout?

4

1 に答える 1

0

シナリオごとに2つのビューファイルを用意します。コードによって目的の場所にビューを追加するという問題で自分をやり過ぎてしまいます。

または、ボタンを保持する1つのビューを用意し、可視性をGONEに設定して、不要なときに閉じるようにします。

((TextView) inflatedview.findViewById(R.id.custombut)).setVisibility(View.GONE);
于 2010-04-02T19:23:41.263 に答える