-1
我需要設置圖像靠近左側的元素。要做到這一點的唯一方法是通過編輯圖像來消除所有邊距?如果我需要它更接近?Android XML ImageView marginLeft屬性
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" />
這是在這一行錯誤:機器人:layout_marginLeft = 「 - 6」
Error: Integer types not allowed (at 'layout_marginLeft' with value '-6').