FrameLayout Shown Above AppBarLayout

断了今生、忘了曾经 提交于 2019-12-04 07:30:01
GPack

The FrameLayout ID (@android:id/content) in the xml and the container (android.R.id.content) in the Fragment transaction refer to the system root of layout, then it is laid over the all screen.

To solve, use them without android prefix.

add app:layout_behavior="@string/appbar_scrolling_view_behavior" to the RecyclerView and it will work. The app:layout_behavior should be to the root of the layout's of your Fragment

ʍѳђઽ૯ท

https://stackoverflow.com/a/24713989/4409113

In AppCompat, there is no native support for ActionBar. android.R.id.content is the container of entire app screen. This means - including ActionBar, because ActionBar is emulated there and added as a standard view hierarchy.

You may want to use(In the Layout):

android:id="@+id/content"

And(in Java):

getSupportFragmentManager().beginTransaction().add(R.id.content, fragment,
                UserCheckinsFragment.class.getName()).commit();

Then, it should work.

Hi i had the same problem and i fixed it by adding"app:layout_behavior="@string/appbar_scrolling_view_behavior"‌" into my layout parent which is linear layout and contain the RecylerView Layout and now it works correctly but i have an other problem that the button which is in the boutmn of the page disapear

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