2016-12-26 44 views
1

如何在不调整ImageView大小的情况下调整ImageView中的图像大小?ImageView Android Image res resize

我需要的是这样的:

enter image description here

是相同的图像,但ImageView的大小不同

+0

使用“scaleType '属性 –

+0

用户不同的可绘制图标,如drawable-xxxhdpi,drawable-xxhdpi,drawable-xhdpi,drawable-mdpi,drawable-hdpi。 –

+0

使用此工具为android生成不同密度的图像或图标https://romannurik.github.io/AndroidAssetStudio/ – xFighter

回答

1

我做了这样的事情:

<FrameLayout 
     android:layout_width="40dp" 
     android:layout_width="40dp" 
     android:background="@drawable/bkgd_circle"/> 

     <ImageView 
      android:layout_width="24dp" 
      android:layout_width="24dp" 
      android:layout_gravity="center" 
      android:src="@drawable/ic_person"/> 

    </FrameLayout>