特牛网址导航

碎片(Fragment)_fragment(碎片)是一种可以嵌入在activity中的ui片段-CSDN博客

网友收藏
1.碎片是什么碎片是一种可以嵌入在活动当中的UI片段2.动态使用碎片:①创建碎片管理者(FragmentManger),使用get方法②创建碎片Transaction,使用begin…方法③使用fragmentTransaction调用方法,完成碎片的操作,最后commit提交。3.在Activity中获取Fragment中的控件和方法:Button button=getFragmentManager().findFragmentById(R.id.right_fragment).getVie_fragment(碎片)是一种可以嵌入在activity中的ui片段