0

我想针对视图“文本”设置文本....但是 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.....");`
4

1 回答 1

2

如果R.id.tv_membersdeal_streampagepage_descriptionTextView,则替换:

View text = row.findViewById(R.id.tv_membersdeal_streampagepage_description);

和:

TextView text = (TextView)row.findViewById(R.id.tv_membersdeal_streampagepage_description);

assetText()是 on 的方法TextView,而不是 on View

于 2013-07-09T12:53:01.557 回答