FragmenManager replace makes overlay

前端 未结 3 1447
无人共我
无人共我 2021-01-06 09:59

I\'m using supportlib v4 to reach master-detail flow.

Problem: New instance of \"details\" fragment overlays the first one (xml created) instead replace it.<

3条回答
  •  借酒劲吻你
    2021-01-06 10:40

    Note: When you add a fragment to an activity layout by defining the fragment in the layout XML file, you cannot remove the fragment at runtime. If you plan to swap your fragments in and out during user interaction, you must add the fragment to the activity when the activity first starts, as shown in the next lesson.

    Which is very last thing on http://developer.android.com/training/basics/fragments/creating.html

提交回复
热议问题