henrytao-me / smooth-app-bar-layout

Smooth version of Google Support Design AppBarLayout
Apache License 2.0
1.77k stars 240 forks source link

how to process the problem of data don't show completely #172

Closed Spring1901 closed 7 years ago

Spring1901 commented 7 years ago

qq 20161222162753

the problem:line0,line1 don't display

because my project don't have a toorBar,so i set the status of the toorbar gone , and add a picture.(my project's head part is consist of a viewpager which used to show Advertisement and a tabLayout ). after i add the picture in xml_layout .the result is that the data can't show completely .

later i change the "SmoothViewPagerQuickReturnActivity" in you demo as the above mentioned ,the same result .

this is my xml file:

<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <me.henrytao.smoothappbarlayout.SmoothAppBarLayout
        android:id="@+id/smooth_app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="@dimen/mdSecondaryActionBarSize">
            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@mipmap/banner2"
                app:layout_scrollFlags="scroll"
                android:visibility="visible"
                />
            <android.support.design.widget.TabLayout
                android:id="@+id/tab_layout"
                android:layout_width="match_parent"
                app:layout_scrollFlags="scroll"
                android:layout_height="wrap_content" />
    </me.henrytao.smoothappbarlayout.SmoothAppBarLayout>
</android.support.design.widget.CoordinatorLayout>
henrytao-me commented 7 years ago

Hi @Spring1901

I suggest you follow this example. If you don't use Toolbar, just keep it in layout file, don't setSupportActionBar for it and set toolbar's background to transparent.

https://github.com/henrytao-me/smooth-app-bar-layout/blob/master/sample/src/main/res/layout/activity_smooth_view_pager_parallax_exit_util_collapsed.xml

Spring1901 commented 7 years ago

@henrytao-me thanks very much for your answer. there is another question i want to ask . i want the tabLayout slide out the screen ,not fix on the top. i have set the attribute of "layout_scrollFlags" to "scroll".but it does't have effect.

henrytao-me commented 7 years ago

Hi @Spring1901

Will your tabLayout show up immediately when you scroll up (like quick return with toolbar)?

Spring1901 commented 7 years ago

yes,I already know how to do it. thanks @henrytao-me