BlankFragment blankFragment = new BlankFragment()
FragmentManager fragmentManager = getFragmentManager()
FragmentTransaction beginTransaction = fragmentManager.beginTransaction()
beginTransaction.add(R.id.frament,blankFragment)
beginTransaction.commit()
beginTransaction.add//添加
beginTransaction.remove//删除
beginTransaction.replace//替换
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
// return inflater.inflate(R.layout.fragment_blank, container, false)
View view = inflater.inflate(R.layout.fragment_blank, container, false)
return view
}
在Fragment 文件里面,写上
静态就直接在name里面写上,不需要再加载