在fragment中使用findviewbyid()

正常在fragment中直接添加findviewbyid会标红
解决方法:
添加一个getactivity()类
类似于下面代码块就可以:

show = (ListView) getActivity().findViewById( R.id.lv_show );

猜你喜欢

转载自blog.csdn.net/qq_45156021/article/details/107435160
今日推荐