1 Fragment入门
[1]Fragment是Activity的一部分
[2]Fragment必须嵌入到Activity里
[3]添加Fragment必须存活于ViewGroup
[4]fragment是在Android3.0被引进
[5]如何声明fragment
1.public static class ExampleFragment extends Fragment {
2. @Override
3. public View onCreateView(LayoutInflater inflater, ViewGroup container,
4. Bundle savedInstanceState) {
5. // Inflate the layout for this fragment
6. return inflater.inflate(R.layout.example_fragment, container, false);
7. }
8.}
[6]在布局里面声明fragment
1.