我想针对视图“text”设置文本....但是settext不能从这里获得任何sujjestion请.... ????
ArrayAdapter<String> adapter = new ArrayAdapter<String>(MembersdealStream_Modified.this,
R.layout.membersdeal_streampagepage_singlerow, R.id.tv_membersdeal_streampagepage_header, targetArray) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = super.getView(position, convertView, parent);
View text = row.findViewById(R.id.tv_membersdeal_streampagepage_description);
text.setTag(position);
text.setOnClickListener(MembersdealStream_Modified.this);
return row;
}
};
我想做像
这样的事情text.setText("Anything.....");`
答案 0 :(得分:2)
如果R.id.tv_membersdeal_streampagepage_description
是TextView
,请替换:
View text = row.findViewById(R.id.tv_membersdeal_streampagepage_description);
使用:
TextView text = (TextView)row.findViewById(R.id.tv_membersdeal_streampagepage_description);
setText()
是TextView
上的方法,而不是View
上的方法。