我想把我的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>
那么,有没有好的方法可以做到这一点呢?