相关疑难解决方法(0)

禁用listview中的滚动

我有一个列表视图,根据一些逻辑,我想临时禁用滚动.view.setOnScrollListener(NULL); 没有帮助我我想我需要写一些代码,有人可以给我一个文件或一些片段吗?

谢谢

android listview scroll listener

42
推荐指数
6
解决办法
8万
查看次数

禁用滚动ScrollView中包含的ListView

我想为我的用户显示个人资料屏幕.

它必须有三个视图(2 Buttons和a ImageView)和a ListView以显示该用户所做的内容.

但是,我不想ListView滚动.相反,我希望它与所需的一样大,并将我的所有视图放在一个中ScrollView,所以三个第一个视图滚动出来ListView.当然,这不符合预期.

我的三件物品都在里面LinearLayout.我想把它们作为第一项ListView,但这导致它们可以作为第一项选择,并且不得不做一些不需要的编码.

有没有办法以简单的方式做到这一点,还是我必须坚持将布局作为ListView中的第一项?

android listview scrollview

35
推荐指数
4
解决办法
8万
查看次数

如何使用ListView使Fragment可滚动

我想要一个有2个ListView的Fragment.我不希望listView滚动而只是想让整个片段滚动.下面是代码:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff" >

    <TextView
        android:id="@+id/day"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:gravity="center_horizontal"
        android:paddingTop="15dp"
        android:text="Monday"
        android:textColor="#000"
        android:textSize="55sp" />

    <TextView
        android:id="@+id/date"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/day"
        android:gravity="center_horizontal"
        android:text="27 April, 2014"
        android:textColor="#000"
        android:textSize="45sp" />

    <ListView
        android:id="@+id/home_list_time"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/date"
        android:layout_margin="10dp"
        android:background="@color/list_home_time_bg"
        android:divider="@android:color/white"
        android:dividerHeight="20.0sp" />

    <ListView
        android:id="@+id/home_list_stime"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/home_list_time"
        android:layout_margin="10dp"
        android:background="@color/list_home_stime_bg"
        android:divider="@android:color/white"
        android:dividerHeight="20.0sp" />

    </RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

当我运行此代码时,第二个listView获得自己的滚动条,有没有办法停止这个并使整个片段滚动?

android listview android-listview android-fragments

5
推荐指数
1
解决办法
1万
查看次数