2

я использую Expandableheightgrideview вид внутри спирального,расширяемый Высота GridView внутри Scrollview

моя проблема, когда я пытаюсь добавить содержимое в GridView, содержание не расширяется должным образом, его отображения 2 полосы прокрутки, когда его высота существует (его предположим, что это одна общая полоса прокрутки для всей страницы). Ботта содержания скрывается для просмотра нижнего содержимого в режиме решетки, необходимо прокручивать вниз.

я использовал exGridView.setExpanded(true);, но не повезло

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="25dp" 
    android:background="@color/transparent" 
    android:fillViewport="true" > 

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

     <com.ExpandableHeightGridView 
      android:id="@+id/result_list" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:horizontalSpacing="2dp" 
      android:isScrollContainer="false" 
      android:numColumns="1" 
      android:stretchMode="columnWidth" 
      android:verticalSpacing="2dp" > 
     </com.ExpandableHeightGridView> 

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

      <LinearLayout 
       android:id="@+id/start_task_layout" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 

       android:layout_gravity="right"> 

       <Button 
        android:id="@+id/homeBtn" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginRight="0dip" 
        android:text="Home" 
        android:textSize="12dip" /> 
      </LinearLayout> 

     </LinearLayout> 
    </LinearLayout> 

</ScrollView> 
+0

http://www.androidhub4you.com/ 2012/12/listview-in-scrollview-in-android.html проверить эту ссылку, это может помочь вам –

ответ

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