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

每个场景有两个视图文件。您将通过代码在所需位置添加视图的问题过度杀伤自己。

或者有一个持有按钮的视图,并将可见性设置为 GONE 以在不需要时关闭。

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