出現這個問題後,發現view沒錯,tvCredit也沒錯,死活不知道緣由,後來網上查到了緣由,setText()裏面的參數必須是String的,而原本的course.getCredit()是int型的。spa
TextView tvCredit = (TextView) view.findViewById(R.id.curri_course_item_credit);
tvCredit.setText(course.getCredit());
更改後就沒問題了code
TextView tvCredit = (TextView) view.findViewById(R.id.curri_course_item_credit);
tvCredit.setText(""+course.getCredit());