- 链接地址:https://blog.csdn.net/weixin_43917227/article/details/119772172
- 链接标题:碎片(Fragment)_fragment(碎片)是一种可以嵌入在activity中的ui片段-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:1261
1.碎片是什么碎片是一种可以嵌入在活动当中的UI片段2.动态使用碎片:①创建碎片管理者(FragmentManger),使用get方法②创建碎片Transaction,使用begin…方法③使用fragmentTransaction调用方法,完成碎片的操作,最后commit提交。3.在Activity中获取Fragment中的控件和方法:Button button=getFragmentManager().findFragmentById(R.id.right_fragment).getVie_fragment(碎片)是一种可以嵌入在activity中的ui片段
版权声明:本文发布于特牛网址导航 内容均来源于互联网 如有侵权联系删除