簡體   English   中英

ScrollView中的ExpandableListView不會滾動

[英]ExpandableListView's inside a ScrollView won't scroll

所以我遇到了這個非常煩人的問題。 我有ExpandableListView's一個內ScrollView A內RelativeLayoutExpandableListView's打開(展開)這就像ScrollView將無法正常工作,我不能滾動讓我下查看的。

XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:focusable="true"
android:focusableInTouchMode="true" 
tools:context="com.example.activity.Activity" >

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true" >

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >
<TextView
    android:id="@+id/emai_to_send_to_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/emai_to_send_to_text_view_text"
    android:textSize="16sp"
    android:textStyle="bold"
    android:textColor="@color/opening_words_list_view_header_color"
    />

<EditText
    android:id="@+id/emai_to_send_to_edit_text_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="@string/emai_to_send_to_edit_text_hint"
    android:inputType="text"
    android:textSize="18sp"
    android:textColor="@color/selection_text_color"
    android:layout_below="@id/emai_to_send_to_id"
    />

<ExpandableListView
    android:id="@+id/opening_expandable_list_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/emai_to_send_to_edit_text_id"
    />

<TextView
    android:id="@+id/opening_words_text_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/initial_text"
    android:textSize="18sp"
    android:layout_below="@id/opening_expandable_list_view_id"
    android:textColor="@color/selection_text_color"
    />

<TextView
    android:id="@+id/name_header_text_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/name_text"
    android:textSize="16sp"
    android:textStyle="bold"
    android:textColor="@color/opening_words_list_view_header_color"
    android:layout_below="@id/opening_words_text_view_id"
    />

<EditText
    android:id="@+id/name_edit_text_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="@string/name_edit_text_hint"
    android:inputType="text"
    android:textSize="18sp"
    android:textColor="@color/selection_text_color"
    android:layout_below="@id/name_header_text_view_id"
    />

<ExpandableListView
    android:id="@+id/something_i_hate_about_you_expandable_list_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/name_edit_text_id"
    />

<TextView
    android:id="@+id/something_i_hate_about_you_text_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/initial_text"
    android:textSize="18sp"
    android:layout_below="@id/something_i_hate_about_you_expandable_list_view_id"
    android:textColor="@color/selection_text_color"
    />

 <ExpandableListView
    android:id="@+id/hope_you_will_expandable_list_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/something_i_hate_about_you_text_view_id"
    />

<TextView
    android:id="@+id/hope_you_will_text_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/initial_text"
    android:textSize="18sp"
    android:layout_below="@id/hope_you_will_expandable_list_view_id"
    android:textColor="@color/selection_text_color"
    />

<ExpandableListView
    android:id="@+id/ps_expandable_list_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/hope_you_will_text_view_id"
    />

<TextView
    android:id="@+id/ps_text_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/initial_text"
    android:textSize="18sp"
    android:layout_below="@id/ps_expandable_list_view_id"
    android:textColor="@color/selection_text_color"
    />

<TextView
    android:id="@+id/your_name_header_text_view_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/your_name_text"
    android:textSize="16sp"
    android:textStyle="bold"
    android:textColor="@color/opening_words_list_view_header_color"
    android:layout_below="@id/ps_text_view_id"
    />

<EditText
    android:id="@+id/your_name_edit_text_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="@string/your_name_edit_text_hint"
    android:inputType="text"
    android:textSize="18sp"
    android:textColor="@color/selection_text_color"
    android:layout_below="@id/your_name_header_text_view_id"
    />

<Button 
    android:id="@+id/send_email_button_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/send_email_button_text"
    android:layout_below="@id/your_name_edit_text_id"
    />
</RelativeLayout>
</ScrollView>
</RelativeLayout>

同樣在此布局中,我在打開ScrollView收到警告- This ScrollView layout or its RelativeLayout parent is useless

如果您願意,我可以上傳圖片。 請任何人可以幫助,將不勝感激。 謝謝。

因此,據我研究的問題(並且研究了很多),在ExpandableListView處於打開狀態時,無法滾動View's

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM