Я хочу, чтобы при загрузке моей активности верхняя часть прокрутки была на половине высоты экрана (например, img_1.png ). Но я получаю это внизу (как img_2.png ). И его необходимо прокручивать (например, img_3.png , img_4.png , img_5.png в ссылке на привод) во время прокрутки.
А вот и мой код.
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Main4Activity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AppTheme.AppBarOverlay"
app:elevation="6dp">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/col_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?android:attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:scrollIndicators="bottom"
android:background="@android:color/black"
app:layout_collapseMode="parallax"/>
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@drawable/tab_selector"
app:tabGravity="center"
android:layout_gravity="bottom"
app:tabIndicatorHeight="0dp"/>
</android.support.design.widget.CollapsingToolbarLayout>
<View
android:id="@+id/view_below_image"
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/colorPrimary"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="About me"
android:textSize="15dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/colorPrimary" />
<TextView
android:layout_width="match_parent"
android:layout_height="650dp"
android:text="Description"
android:textSize="50dp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Заранее спасибо за помощь.
https://drive.google.com/open?id=1hDELP83a3YV1p1GxnfG0IpLmfwQFKWfr