2012-12-31 13 views
5

obraz w widoku siatki nie jest rozciągliwy.Utwórz rozciągliwy obraz w widoku siatki

Jak mogę go rozciągnąć?

To jest moje.

enter image description here

To jest to, co chcę

enter image description here

GridView

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <LinearLayout 
      android:id="@+id/layout2" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@drawable/bg_base" 
      android:orientation="vertical" > 

      <com.camitss.mcolle.ScrollableGridView 
       android:id="@+id/grid_all" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:columnWidth="110dp" 
       android:gravity="center" 
       android:horizontalSpacing="10dp" 
       android:numColumns="auto_fit" 
       android:padding="5dp" 
       android:verticalSpacing="10dp" /> 
     </LinearLayout> 
    </LinearLayout> 
</ScrollView> 

GridView Przedmiot

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/card_base" 
android:orientation="vertical" > 

<!-- Green Image --> 
<ImageView 
    android:id="@+id/category_card" 
    android:layout_width="105dp" 
    android:layout_height="105dp" 
    android:layout_centerInParent="true" /> 

<!-- Picture --> 
<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="95dp" 
    android:layout_height="95dp" 
    android:layout_centerInParent="true" /> 

+0

zestaw zdjęć długość i wysokość = wypełnić rodzic, zamiast "xxdp" – swiftBoy

+0

to nie jest praca. Testuję to już. : D – kongkea

+0

Pozwól mi spróbować! po prostu udostępnij zdjęcia źródłowe – swiftBoy

Odpowiedz

6

Spróbuj

<!-- Picture --> 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="95dp" 
     android:layout_height="95dp" 
     android:layout_centerInParent="true" 
     android:scaleType="fitXY" 
     android:adjustViewBounds="true" /> 
+0

Dzięki za pomoc mi Appu – kongkea

+0

Jesteś jak zawsze witaj kongkea. – Kanth

Powiązane problemy