相关疑难解决方法(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万
查看次数

Android ScrollView布局问题

我在LinearLayout中有几个ListView.它是白天列出的东西,所以我有一个TextView包含"Sunday:"后跟一个项目列表,然后是"Monday"TextView等.效果很好,但不适合屏幕.所以我添加了一个ScrollView作为LinearLayout的父级.现在它滚动,但ListViews都有2个条目的空间,无论它们有0或3个条目.有关添加ScrollView父级的信息导致ListViews无法动态调整大小.我尝试在列表适配器填充其视图后在ScrollView上调用requestLayout(),但这没有做任何事情.有任何想法吗?

编辑:从http://www.anddev.org/viewtopic.php?p=25194和其他链接看来,ScrollView中的ListViews无法正确处理.任何人都有一个很好的建议来实现列表清单?

android scrollview

11
推荐指数
2
解决办法
3万
查看次数

ScrollView中的ListView

可能重复:
ScrollView中的Listview不在Android上滚动

我有一个ListView内部ScrollView,问题ScrollView是滚动但ListView不滚动.我认为这是因为这一点ScrollView.有没有人有这个问题的解决方案?

android listview scrollview

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

android ×3

scrollview ×3

listview ×2

android-layout ×1