Android fragments overlap

五迷三道 提交于 2019-12-02 08:30:22

Instead of using in layout xml fragment:

<fragment
    android:id="@+id/detailFragment"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="2"
    class="com.fragments.FragmentOrderDetails" >

</fragment>

Use some container like LinearLayout or FrameLayout with some containerId. Then programatically firstly add fragment to this container using containerId, and after that replace content of this container with containerId also.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!