我在content_main中使用導航抽屜活動時會出現一個線性佈局,它將與片段一起膨脹。在其他視圖的滾動中隱藏視圖
content_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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/content_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="net.techdesire.khabargujarat.HomeActivity"
tools:showIn="@layout/app_bar_home">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment_container"/>
</RelativeLayout>
fragment_home.xml
<android.support.percent.PercentRelativeLayout
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"
tools:context="fragment.HomeFragment">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
app:layout_heightPercent="40%"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
app:layout_heightPercent="60%"
android:layout_below="@+id/viewpager">
<TextView
android:id="@+id/about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/about_khijadiya"
android:textAppearance="@style/TextAppearance.AppCompat.Large"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/about"
android:text="@string/dummy"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"/>
</RelativeLayout>
</android.support.percent.PercentRelativeLayout>
我有一個名爲約TextView中大內容。我想讓它滾動,就像image.First首先滾動相關圖層到全屏,如果about的內容仍然溢出,那麼只能製作關於textview的滾動條。當滾動到達頂部時,如果用戶從那裏向下滑動,然後重新顯示viewpager。
我不明白你想要什麼。你能試着解釋另一種方式嗎? –