-1
Solution: link
Good evening, guys, how are you? I have a problem and to be clear I took a print to show you:
As you can see the list (Recyclerview) is getting behind while it should be below the Toolbar/Actionbar, I don’t know what I’m doing wrong, but I couldn’t solve this problem, does anyone know the solution? I’m only using the support library and nothing else, the error occurs in both emulator and Android 4.1 and 7 too, both real devices. This Toolbar hides when the user scrolls down the screen, in case when he swipes his finger from the bottom up, but this is not a problem I really set up to work like this.
I’ve researched several ways but I can’t get anything related to this, always comes results of other problems or other features.
If I find the solution I will post here...
Follows XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cl_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ListContatosActivity">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_swipe"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_list"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"/>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_height="wrap_content"
android:background="@color/bg_cadastro"
android:layout_width="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
I’m sorry the fault friend I don’t know why I didn’t get XML all if I gave Ctrl+a, but the parent view is a Coordinatorlayout, I’ll edit the question and put the whole XML.
– MateusFMello
The problem was here at Stackoverflow, the parent view had been out of code tags and were not displayed so...
– MateusFMello
Please collaborate with the quality of community content by better elaborating your response. Very short answers will hardly be clear enough to add anything to the discussion. If your response is based on some function or feature of the language/tool, link to the official documentation or reliable material that supports your response. Searching for similar questions in the community can also be interesting to indicate other approaches to the problem.
– Woss
@Andersoncarloswoss his answer was not very big, but it was straight to the point and took me the solution, he did not give a theoretical explanation but even so the answer helped to solve the problem.
– MateusFMello