0

Так что я получил эту действительно раздражающую проблему. У меня есть ExpandableListView's внутри ScrollView внутри RelativeLayout и когда открыты ExpandableListView's (развернуть) это как ScrollView не будет работать, и я не могу прокрутить, чтобы добраться до моего нижнего вида.ExpandableListView внутри 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

Я могу загрузить фотографии, если Youd нравится. Пожалуйста, если кто-то может помочь, он будет очень признателен. Благодарю.

+0

Пожалуйста, ** избегайте ** вложенных прокручиваемых представлений !! –

+0

@ FrankN.Stein Спасибо за ответ. Но как я могу прокрутить много «ExpandableListView», даже когда они открыты? – God

+0

Лучше не иметь их всех в одном окне. –

ответ

0

Так как я изучал проблему (и я ее много изучил), вы не можете получить View's, чтобы прокручивать, когда ExpandableListView находится в открытом состоянии.

Смежные вопросы