码迷,mamicode.com
首页 > 其他好文 > 详细

fragment 切换

时间:2015-05-18 16:06:55      阅读:94      评论:0      收藏:0      [点我收藏+]

标签:

1.Fragment的添加方式

FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.hide
ft.show
ft.add
ft.replace
ft.hide---ft.show
a.let the old fragment to hide, but not delete in memory, so it will quick showing after calling show
b.when calling ft.replace it will delete all old memory, and it will onCreateView for a new time when show this.
c.ft.add it using with ft-hide/ft.show, not delete fragment in memory.
d.ft.remove sync using with ft.add. just remove what you want .

fragment 切换

标签:

原文地址:http://www.cnblogs.com/deman/p/4511891.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!