【发布时间】:2014-07-25 16:54:56
【问题描述】:
我需要将图像设置得比左边的元素更近。做到这一点的唯一方法是编辑图像,去掉所有的边距?如果我需要更近的地方怎么办?
marginLeft 是否接受负值?
这是 ImageView 在 xml 文件中的样子:
<ImageView
android:id="@+id/lineOneImageView"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="false"
android:layout_marginLeft="-6"
android:layout_toRightOf="@id/productNameTextView"
android:contentDescription="@string/text_placeholder"
android:scaleType="fitXY"
android:src="@drawable/img_i_black_normal" />
这是这一行的错误:android:layout_marginLeft="-6"
Error: Integer types not allowed (at 'layout_marginLeft' with value '-6').
【问题讨论】:
标签: android xml syntax-error