zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to com.demo

AndroidJAVA to Cannot be Demo com lang
2023-09-14 09:13:59 时间

android的报错提示:

java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to com.demo.test.view.ExpandTextView

错误在哪,我不说多

解决:

报错信息中:ExpandTextView(自定义),就是我不小心把ExpandTextView写成TextView

所以说:
R.id.textView是TextView 类型,R.id.button是Button类型,不要绑定类型出错