【发布时间】:2017-02-20 19:53:15
【问题描述】:
我在RelativeLayout 中有textview 和listview。滚动列表视图时如何滚动此文本视图?当我滚动列表视图时,我希望 textview 不会从顶部挂出
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:padding="10dp"
android:paddingBottom="0dp"
android:id="@+id/info_presents_surveys"
android:text="@string/info_presents_surveys"
android:textColor="@color/empty_color"
android:background="@color/color_gray"/>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/info_presents_surveys">
<ListView
android:id="@+id/list_view_surveys"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/members_speakers.divider"
android:dividerHeight="1dp" />
</android.support.v4.widget.SwipeRefreshLayout>
【问题讨论】:
-
您是否也想让 textview 向上滚动?如果是这样,请将所有内容放在 Scroll 或 RecyclerView 中。
-
RecyclerView是怎么做到的?
-
研究的魔力!这就是软件开发的重点和乐趣所在。学习!如果我确切地告诉你如何做到这一点,你将永远学不会。从字面上将 RecyclerView 粘贴到谷歌,我保证你会找到大量的资源。
标签: java android listview scroll textview