發表文章

目前顯示的是 10月, 2017的文章

那些年遇到Fragment的坑

1. Can I remove a fragment defined in a layout.xml file? 可以在程式裡,移除寫在layout裡的fragment嗎? 答案是不行,就算要hide起來也是不行。 程式會自動幫你keep住layout裡的fragment,想移都移不掉。 建議如果會要用到比較彈性的作法,可以直接在code裡面動態加fragment。 https://stackoverflow.com/questions/8903874/can-i-remove-a-fragment-defined-in-a-layout-xml-file Solution https://xnfood.com.tw/fragment02/