2016-01-17 45 views
0

我對ListView有問題。我想讓ListView中的圖像更大。 我試圖設置機器人:layout_height =「match_parent」,但它不工作:(如何在ListView中使圖像視圖變大

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

    <SquaredFrameLayout 
     android:id="@+id/vImageRoot" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <ImageView 
      android:id="@+id/ivFeedCenter" 
      android:layout_width="match_parent" 
      android:src="@drawable/img_feed_center_2" 
      android:layout_height="match_parent" /> 

    </SquaredFrameLayout> 

    <ImageView 
     android:id="@+id/ivFeedBottom" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:paddingLeft="8dp" 
     android:paddingRight="8dp"> 

     <ImageButton 
      android:id="@+id/btnLike" 
      android:layout_width="48dp" 
      android:layout_height="48dp" 
      android:background="@drawable/btn_feed_action" 
      android:src="@drawable/ic_heart_small_blue" /> 

     <LinearLayout 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_weight="1" 
      android:gravity="center_vertical|right"> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@drawable/ic_heart_small_blue" /> 

      <TextSwitcher 
       android:id="@+id/tsLikesCounter" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="8dp" 
       android:layout_marginRight="8dp" 
       android:inAnimation="@anim/slide_in_likes_counter" 
       android:outAnimation="@anim/slide_out_likes_counter"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="123 likes" 
        android:textColor="@color/text_like_counter" /> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:textColor="@color/text_like_counter" /> 
      </TextSwitcher> 
     </LinearLayout> 
    </LinearLayout> 

</LinearLayout> 

我想,它看起來 但看起來

對不起,我的英語不好:) 非常感謝提前。

回答

0
<ImageView 
     android:scaleType = "centerCrop" 
     android:id="@+id/ivFeedCenter" 
     android:layout_width="match_parent" 
     android:src="@drawable/img_feed_center_2" 
     android:layout_height="match_parent" />