课堂笔记
- 首先创建带 顶部Bar 和 “新坑” 的布局 base_home_fragment_layout
- BaseFragment 创建加载 rootView 的方法
protected View loadRootView(LayoutInflater inflater, ViewGroup container) {
return inflater.inflate(R.layout.base_fragment_layout, container, false);
}
- HomeFragment 重写 loadRootView 方法,加载带 顶部Bar rootView
@Override
protected View loadRootView(LayoutInflater inflater, ViewGroup container) {
return inflater.inflate(R.layout.base_home_fragment_layout,container,false);
}