我正在学习RecyclerView
并且我的回收商遇到了问题:
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/bootik_recycler"
/>
上课:
public class BotikFragment extends Fragment {
private RecyclerView recyclerView;
private View view;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.recycler_botik,container);
return view;
recyclerView=(RecyclerView)view.findViewById(R.id.bootik_recycler);
我收到Unreachable Statement
错误。
答案 0 :(得分:1)
只是将最后两个语句按不同顺序排列:
recyclerView=(RecyclerView)view.findViewById(R.id.bootik_recycler);
return view;