<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#e6e6e6"
android:orientation="vertical">
<TextView
android:id="@id/knowledge2_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_height"
android:background="@color/titlebg"
android:gravity="center"
android:text="知识"
android:textColor="@android:color/white"
android:textSize="@dimen/titletextsize" />
<RelativeLayout
android:id="@id/knowledge2_fragment"
android:layout_width="match_parent"
android:layout_height="@dimen/knowledge_image_height"
android:layout_below="@id/knowledge2_title" >
<android.support.v4.view.ViewPager
android:id="@id/knowledge_pager"
android:layout_width="match_parent"
android:layout_height="@dimen/knowledge_image_height"
android:layout_alignParentTop="true"/>
<RelativeLayout
android:id="@id/knowledge_rl1"
android:layout_width="match_parent"
android:layout_height="@dimen/knowledge_image_texth"
android:layout_alignBottom="@id/knowledge_pager"
android:background="#80000000">
<TextView
android:id="@id/knowledge_pagertext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="13dip"
android:textSize="20sp"
android:textColor="@android:color/white"/>
<RadioGroup
android:id="@id/knowledge_radiogroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dip">
<RadioButton
android:id="@id/knowledge_rb1"
style="@style/image_dotstyle"
android:layout_marginRight="10dip"/>
<RadioButton
android:id="@id/knowledge_rb2"
style="@style/image_dotstyle"
android:layout_marginRight="10dip"/>
<RadioButton
android:id="@id/knowledge_rb3"
style="@style/image_dotstyle"
android:layout_marginRight="10dip"/>
<RadioButton
android:id="@id/knowledge_rb4"
style="@style/image_dotstyle"/>
</RadioGroup>
</RelativeLayout>
</RelativeLayout>
<com.yeahis.swimcoach.widget.MySwipeRefreshLayout
android:id="@id/knowledge2_swiperefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<ListView
android:id="@id/knowledge2_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="@android:color/transparent"
android:scrollbars="vertical"
android:divider="@null"/>
</com.yeahis.swimcoach.widget.MySwipeRefreshLayout>
</LinearLayout>
com.yeahis.swimcoach.widget.MySwipeRefreshLayout与android.support.v4.widget.SwipeRefreshLayout相同。
答案 0 :(得分:0)
我认为你应该做的是创建2个布局:一个处理viewpager
内容,一个处理viewpager
和listview
:
layout_1.xml
<LinearLayout...>
Content to be refresh in this layout
</LinearLayout>
layout_2.xml
<LinearLayout...>
<ViewPager .../>
<ListView ..../>
</LinearLayout>
您创建了一个适配器来处理viewpager中显示layout_1.xml
的viewpager和内容,每当您滑动时,listview
都将保持不变。
listview