我使用的是ListView
,在我所充氣另一個layout template
其中包含的2 Images, an edit text, a correction button , and 2 more buttons,
一個是快速編輯按鈕,現在我想on click on this quick edit button
編輯文本應成爲可編輯和correction button should become visible.
可以請你幫我。改變編輯框中的文本列表視圖按鈕點擊android系統
從意見,爲方便閱讀:
mv.quick_edit = (ImageButton)convertView.findViewById
(R.id.gateway_list_info_image_button_temp);
mv.quick_edit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MyViewHolder m = new MyViewHolder();
m.correct_button.setVisibility(View.VISIBLE);
m.edit_text.setText("text changed");
}
});
我已經試過它..它不工作 – shruti
和你得到什麼錯誤? –
,因爲在onclick方法mView顯示錯誤...因爲它是在onclick方法的外部定義的 – shruti