是否有可能在约束布局上实现负边距以实现重叠?我试图让一个图像以布局为中心,并有一个文本视图,使其重叠x x dp.我尝试设置负保证金值,但没有运气.如果有办法实现这一目标会很棒.
我想移动我的位置,ImageView这样它会距离ConstraintLayout(父对象)一半。LinearLayout
我所拥有的是图像,应该按照图片上的说明进行裁剪,因此图像的仅按钮侧应显示在实际设备上。其他部分应切除。
这是我的布局的一部分。
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="71dp"
android:layout_height="71dp"
android:src="@drawable/someImage"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)
那么,有什么好办法吗?