Java 无法解析方法膨胀(android.context.context)
我面临这个方法的问题,它说Java 无法解析方法膨胀(android.context.context),java,android,android-recyclerview,Java,Android,Android Recyclerview,我面临这个方法的问题,它说无法解决方法膨胀(android.context.context) 取代 View view= LayoutInflater.inflate(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false); 与 LayoutInflater.inflate(parent.getContext())应该是一个LayoutInflater.from(parent.getContext())。尝试
无法解决方法膨胀(android.context.context)
取代
View view= LayoutInflater.inflate(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false);
与
LayoutInflater.inflate(parent.getContext())
应该是一个LayoutInflater.from(parent.getContext())
。尝试将其添加为答案@wizard好的,谢谢我犯了一个愚蠢的错误,问题解决了now@Wizard将此添加为答案,如果有效,请接受。
View view= LayoutInflater.inflate(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false);
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false);