相关疑难解决方法(0)

ScrollView中的ListView不在Android上滚动

我在滚动ListView里面遇到麻烦ScrollView.我有一个Activity在顶部有一些EditTexts,然后是一个带有两个选项卡的选项卡主机,每个选项卡都有一个ListView.当EditText视图聚焦时,软键盘出现,因为我有一个ScrollView,内容是可滚动的.但问题出现在ListViews中有更多项目(选项卡中的项目),即使有更多项目,我也无法滚动ListView.

以下是布局XML:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="?backgroundImage"
    android:orientation="vertical">

  <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_alignParentBottom="true"
        android:layout_margin="10dip"
        android:id="@+id/buttons">
    <Button
            android:text="Save"
            android:layout_margin="2dip"
            android:textSize="20dip"
            android:id="@+id/btnSaveorUpdate"
            android:layout_height="wrap_content"
            android:layout_width="145dip"></Button>
    <Button
            android:text="Cancel"
            android:layout_margin="2dip"
            android:textSize="20dip"
            android:id="@+id/btnCancelorDelete"
            android:layout_height="wrap_content"
            android:layout_width="145dip"></Button>
  </LinearLayout>
  <ScrollView
        android:layout_above="@id/buttons"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fillViewport="true"
        android:layout_margin="10dip">
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_margin="10dip">
      <TextView
                android:text="Bill details"
                android:textColor="?textColorDark"
                android:layout_alignParentTop="true"
                android:id="@+id/txtEnterDetails"
                android:textSize="25dip"
                android:textStyle="bold"
                android:layout_height="wrap_content"
                android:layout_width="fill_parent"
                android:layout_marginBottom="2dip"></TextView>
      <LinearLayout
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:layout_width="0dip"
                android:layout_height="0dip" />
      <EditText
                android:layout_width="fill_parent"
                android:hint="Enter data"
                android:inputType="numberDecimal"
                android:id="@+id/txtSample"
                android:textSize="@dimen/editText"
                android:layout_height="@dimen/editTextHeight"
                android:text=""></EditText>
      <EditText
                android:layout_width="fill_parent"
                android:id="@+id/txtDescription"
                android:hint="Enter description"
                android:textSize="@dimen/editText" …
Run Code Online (Sandbox Code Playgroud)

android listview scrollview android-layout

151
推荐指数
9
解决办法
20万
查看次数

NestedScrollView中的RecyclerView ScrollListener

我有一个EndlessRecyclerView结束了NestedScrollView.EndlessRecyclerView表示:当用户滚动到recyclerView的底部时,它会加载更多数据.这是已经实现的和其他地方的工作,但是当我把recyclerView内部NestedScrollViewOnScrollListener事件不火.

XML设计:

<NestedScrollView>

     <Other views/>

     <EndlessRecyclerView/>

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

码:

recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            // This is never fired! Here is where I implement the logic of EndlessRecyclerView
        }
    });
Run Code Online (Sandbox Code Playgroud)

如何获得上述案例的滚动事件?

我知道在彼此内部有两个可滚动视图并不好.但是,如果没有两个可滚动的视图,我怎么能有上述情况呢?

我已经按照这个链接但它不起作用:scrollview android里面的recyclelerview滚动事件

android infinite-scroll onscrolllistener android-recyclerview android-nestedscrollview

22
推荐指数
1
解决办法
9325
查看次数

在ScrollView中使用RecyclerView,灵活的Recycler项目高度

我想知道有没有可能的方法来使用RecyclerView

在此之前,我在ScrollView中使用具有修复高度的 RecyclerView,但这次我不知道项目的高度.

提示:我在4天前提出这个问题之前,先阅读了堆栈问题的所有问题和解决方案.

更新: 一些解决方案学习如何自己滚动RecyclerView但我想展示这个扩展.

android scrollable android-scrollview android-recyclerview

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