【发布时间】:2015-02-13 15:40:06
【问题描述】:
我有一个简单的问题,我有一个简单的RelativeLayout 和一个ImageView(很快会添加更多内容)。但是,ImageView 的宽度和高度设置为wrap_content,但是当检查时,宽度正确对齐(可能是因为它是屏幕的最大宽度)但高度似乎比实际图像更进一步。这些图像是通过 Adobe Illustrator 制作的,然后导出为 .png,DPI 为 480。
例子:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
tools:context=".MainActivity"
android:background="#d1070707">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/outer_shell"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:src="@drawable/out_shell" />
</RelativeLayout>
[由于rep
问题:http://postimg.org/image/75ijbo1zv/
显示我的图片没有更大的边框:http://postimg.org/image/mog8ijghb/
但是,如果我将图像进一步向下移动到包裹内容区域理论上会被切断的位置,它会根据我设置的边距值将自身(高度)调整得越来越小。 所以,如果有人知道它为什么会这样并且可以解释,那就太好了!
【问题讨论】:
标签: android xml android-imageview dpi android-relativelayout