我有一個父視圖分頁器的片段。Listview不是垂直滾動嗎?
在瀏覽器中有兩個片段,分別叫做1stFragVP和2ndFragVP。
在1stFragVP的佈局我有Listview。
查看尋呼機能夠水平滾動,但不會發生listview垂直滾動。
父片段XML
<LinearLayout 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:background="@color/white"
android:orientation="vertical">
<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="0dp"
android:layout_below="@id/parent_ll"
android:layout_marginTop="15dp"
android:layout_weight="5">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="45dp">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
style="@style/CustomTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#f1f1f2"
app:elevation="0dp"
app:tabGravity="fill"
app:tabIndicatorColor="@color/orange"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
1 FragVP XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:divider="#ebf2f2"
android:dividerHeight="0dp"/>
<RelativeLayout
android:id="@+id/no_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:layout_centerInParent="true"
android:visibility="gone">
<TextView
android:id="@+id/no_item_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/medium_font" />
</RelativeLayout>
</RelativeLayout>
發佈您的代碼xml java文件等 – Noorul
@Ahamed請再次檢查問題。 –