Android ImageView很小?

我按照android trainning上加了三张图片,可是最后一张缩小了很多,前面两张挺大的,压缩了最后一张图片的空间。

    <ImageView
        android:id="@+id/donut"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/choose_dessert"
        android:contentDescription="@string/donuts"
        android:onClick="showDonutOrder"
        android:padding="@dimen/padding_regular"
        android:src="@drawable/donut_circle" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/choose_dessert"
        android:layout_toRightOf="@id/donut"
        android:padding="@dimen/padding_wide"
        android:text="@string/donuts" />

    <ImageView
        android:id="@+id/ice_cream"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/donut"
        android:contentDescription="@string/ice_cream_sandwiches"
        android:onClick="showIceCreamOrder"
        android:padding="@dimen/padding_regular"
        android:src="@drawable/icecream_circle" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/donut"
        android:layout_toRightOf="@+id/ice_cream"
        android:padding="@dimen/padding_wide"
        android:text="@string/ice_cream_sandwiches" />

    <ImageView
        android:id="@+id/froyo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/ice_cream"
        android:contentDescription="@string/froyo"
        android:onClick="showFroyoOrder"
        android:padding="@dimen/padding_regular"
        android:src="@drawable/froyo_circle" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ice_cream"
        android:layout_toRightOf="@+id/froyo"
        android:padding="@dimen/padding_wide"
        android:text="@string/froyo" />

怎么让第三章图片显示正常呢?

阅读 3.1k
4 个回答

哥,你这问题是?

新手上路,请多包涵

能不能有个图吗

设置一下scaleType = fitXY 试试

看代码 是RelativeLayout 纵向布局,
你先看下图片的真实像素吧,毕竟你每张图都是自适应的

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题