noties / Scrollable

Android scrollable tabs
Apache License 2.0
1.24k stars 229 forks source link

Scrollable tab scrolls under title bar #61

Closed mcutchember closed 6 years ago

mcutchember commented 6 years ago

Hello, I am trying to figure out how I can keep my scrollable tab under my title bar. I added a view and to give you a little context, I am creating a profile page. As of now, it scrolls perfectly but it goes all the way to the top beneath the title bar. I would like it to scroll only to the title bar.

I am using a viewPager for the tabs. I have provided images.

images: https://imgur.com/4fn0nK6 https://imgur.com/aTQFbr1 (this what i want) https://imgur.com/BWoMzKW (but this happens)

https://imgur.com/bFYJsdN https://imgur.com/tRBX2zl

THis may be a dumb question but thank you anyway.

noties commented 6 years ago

Hello @mcutchember !

There are no dumb questions. I think there is a problem with your layout. If you change it to be like this:

<?xml version="1.0" encoding="utf-8"?>
<ru.noties.scrollable.ScrollableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:scrollable_autoMaxScroll="true">

    <View
        android:id="@+id/view"
        android:layout_width="match_parent"
        android:layout_height="300dip"/>

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="56dip"/>

    <android.support.v4.view.ViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="56dip"/>

</ru.noties.scrollable.ScrollableLayout>

The issue should be resolved. Please note what I had done:

Hope this helps!