0

いくつかの要素を含む LinearLayout を含むメインの Scrollview レイアウトがあります。

  • ExpandableListView #1 (まだ 1 つの子)
  • テキストビュー
  • ExpandableListView #2 (まだ 1 つの子)
  • いくつかのテキスト ビュー

私が遭遇する問題は、ExpandableListView のいずれかをクリックすると、表示自体が展開されないことです。

このスクリーン キャプチャで展開されていないビューを確認できます (まだクリックされていません)。

https://plus.google.com/photos/101037819512700772601/albums/5870915782494751761/5870915784486932322

このスクリーン キャプチャで、(ExpandableListViews をクリックすると) ビューが展開されていることがわかります。

https://plus.google.com/photos/101037819512700772601/albums/5870915782494751761/5870915780856077570

そこに私のレイアウトがあります:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" 
android:layout_width="match_parent"
android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

            <ExpandableListView 
                android:id="@+id/expandableView" 
                android:layout_width="match_parent" 
                android:layout_height="match_parent">
            </ExpandableListView>

            <TextView
                android:id="@+id/providerNameView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:layout_marginTop="2dp"
                android:text="ABCDEF1"
                android:textSize="25sp"
                android:textStyle="bold" />         

            <ExpandableListView
                android:id="@+id/expandableView2"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            </ExpandableListView>

            <TextView
                android:id="@+id/providerNameView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:layout_marginTop="2dp"
                android:text="ABCDEF2"
                android:textSize="25sp"
                android:textStyle="bold" />         

             . . . 

    </LinearLayout>     

</ScrollView>

私の問題の解決策はありますか?

4

1 に答える 1

0

まず最初に。複数の垂直スクロール ビューをネストすることはできません。それ以外の場合は、適切なタッチ イベントをオーバーライドしてすべてを適切に処理しようとするフィールド デイが発生します。

リストのスクロールに合わせて他のビューをスクロールする必要がある場合は、ヘッダー/フッター ビューを追加するだけです。それを「スティッキー」にする必要がある場合は、大まかなGoogle検索でスティッキーヘッダーライブラリが見つかりました。

于 2013-04-26T23:36:40.900 に答える