0

Мой текущий МакетScrollbar + LinearLayout + GridView .. GridView не прокрутке

enter image description here

<?xml version="1.0" encoding="utf-8"?> 

<ScrollView 
    android:id="@+id/scrMain" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:layout_gravity="top" 
    android:fillViewport="true" > 


    <RelativeLayout 
     android:id="@+id/rl" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

     <RelativeLayout 
      android:id="@+id/llGridToday" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical" android:visibility="gone"> 

      <FrameLayout 
       android:id="@+id/FrameLayout1" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentTop="true" > 

       <ImageView 
        android:id="@+id/imageView2" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:src="@drawable/gridframe" /> 

       <FrameLayout 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="right" 
        android:layout_marginRight="10dp" 
        android:layout_marginTop="10dp" 
        android:background="@drawable/calender" > 

        <TextView 
         android:id="@+id/txtDateToday" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center" 
         android:gravity="center" 
         android:text="28" /> 
       </FrameLayout> 

       <TextView 
        android:id="@+id/textView1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="10dp" 
        android:layout_marginTop="3dp" 
        android:text="Today" 
        android:textColor="#000" /> 
      </FrameLayout> 

      <GridView 
       android:id="@+id/gridToday" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentBottom="true" 
       android:layout_alignParentLeft="true" 
       android:layout_below="@+id/FrameLayout1" 
       android:layout_weight="1" 
       android:numColumns="3" > 
      </GridView> 
     </RelativeLayout> 

     <RelativeLayout 
      android:id="@+id/llGridTomorrow" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_below="@id/llGridToday" 
      android:orientation="vertical" android:visibility="gone"> 

      <FrameLayout 
       android:id="@+id/FrameLayout1" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentTop="true" > 

       <ImageView 
        android:id="@+id/ImageView01" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:src="@drawable/gridframe" /> 

       <FrameLayout 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="right" 
        android:layout_marginRight="10dp" 
        android:layout_marginTop="10dp" 
        android:background="@drawable/calender" > 

        <TextView 
         android:id="@+id/txtDateTomorrow" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center" 
         android:gravity="center" 
         android:text="28" /> 
       </FrameLayout> 

       <TextView 
        android:id="@+id/TextView02" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="10dp" 
        android:layout_marginTop="3dp" 
        android:text="Tomorrow" 
        android:textColor="#000" /> 
      </FrameLayout> 

      <GridView 
       android:id="@+id/gridTomorrow" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentBottom="true" 
       android:layout_alignParentLeft="true" 
       android:layout_below="@+id/FrameLayout1" 
       android:layout_weight="1" 
       android:numColumns="3" > 
      </GridView> 
     </RelativeLayout> 

     <RelativeLayout 
      android:id="@+id/llGridMonth" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/llGridTomorrow" 
      android:orientation="vertical" android:visibility="gone"> 

      <FrameLayout 
       android:id="@+id/FrameLayout1" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentTop="true" > 

       <ImageView 
        android:id="@+id/ImageView02" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:src="@drawable/gridframe" /> 

       <TextView 
        android:id="@+id/TextView03" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="5dp" 
        android:layout_marginTop="2dp" 
        android:text="This Month" 
        android:textColor="#000" /> 
      </FrameLayout> 

      <GridView 
       android:id="@+id/gridMonth" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_below="@+id/FrameLayout1" 
       android:numColumns="3" android:stretchMode="columnWidth"> 
      </GridView> 
     </RelativeLayout> 
    </RelativeLayout> 
</ScrollView> 

Это Layout содержит три GridViews. Я делаю родительский RelativeLayout с GridViews видна с логикой и добавляет завышенные ImageView + TextView к GridView.

Его взгляд прекрасный. но прокрутки нет.

+0

Ввод прокруткой вещи в прокручивать такие вещи, как это редко работает. 'ScrollView', в частности, редко работает из коробки с вещами, которые прокручиваются вертикально, например' GridView'. – CommonsWare

+0

gridviews только прокручиваются (по умолчанию) только при выходе из экрана .... тогда вы можете подумать об использовании держателя для хранения данных. –

ответ

2

Да, какой смысл иметь три разных GridView. Просто создайте одиночный GridView как родительский и создайте отдельный макет для GridItem, чтобы вы могли его стилизовать так, как вам нужно.

UPDATE

это не то, как это будет работать для вас ???

один макет со следующим кодом

 <GridView 
      android:id="@+id/gridTomorrow" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:layout_alignParentLeft="true" 
      android:layout_below="@+id/FrameLayout1" 
      android:layout_weight="1" 
      android:numColumns="3" > 
     </GridView> 

и другой макет для GridItem

 <FrameLayout 
      android:id="@+id/FrameLayout1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" > 

      <ImageView 
       android:id="@+id/ImageView01" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@drawable/gridframe" /> 

      <FrameLayout 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="right" 
       android:layout_marginRight="10dp" 
       android:layout_marginTop="10dp" 
       android:background="@drawable/calender" > 

       <TextView 
        android:id="@+id/txtDateTomorrow" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:gravity="center" 
        android:text="28" /> 
      </FrameLayout> 

      <TextView 
       android:id="@+id/TextView02" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" 
       android:layout_marginTop="3dp" 
       android:text="Tomorrow" 
       android:textColor="#000" /> 
     </FrameLayout> 

используя GridAdapterInflate вашей GridItems в сетке

+0

В соответствии с текущей логикой .. Оба выше RelativeLayouts, содержащие 2 gridViews, заметно исчезли .. но 3 gridviews должны соответствовать функциональности, как я упоминал ниже в ответе на комментарий Macarse. –

+0

У меня есть логика понимания времени за макетом. @Vishal имеет вывешенный. Кто-нибудь еще из этого понимает? – Mayank

+0

, пожалуйста, объясните свою функциональность requiremnts, чтобы я мог понять логику. Спасибо – Mayank

0

Не знаете, зачем вам три разных GridView.

Попробуйте сделать GridView родителем и добавьте остальную часть View элементов в качестве заголовков GridView.

+0

@Macarase. Все три представления предназначены для разных типов данных, а обработка кликов этих данных также различна для всех трех элементов gridview. Поэтому я думал, что это должно иметь 3 diff. gridviews .. –

+0

@Vishal: Попробуйте добавить каждый тип в один и тот же «GridView». – Macarse