スクロールビューを作成しようとしました。ただし、viewPagerはスクロールビュー内に表示されません。どの部分が間違っているのか分かりません。スクロールビューが相対レイアウトで機能しない
これは私のxmlファイルである
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="com.example.qianonnphoon.tradeal.displaytrade.DisplayTradeActivity">
<RelativeLayout
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="wrap_content">
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@drawable/tab_selector"
app:tabGravity="center"
app:tabIndicatorHeight="0dp">
</android.support.design.widget.TabLayout>
</android.support.v4.view.ViewPager>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="23dp"
android:layout_below="@+id/view_pager"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/tvOwnItemName"/>
</RelativeLayout>
</ScrollView>
です。私は
として設定することができない理由を知らないそれはviewPagerを表示:fillViewportは=「true」を。ただし、スクロール可能ではありません。テキストビューを表示するためにスクロールできません – phoon
テキストビューに何かを書きましたか? –
はい、アンドロイドを追加する前にテキストを見ることができます:fillViewport = "true"。 – phoon