【发布时间】:2018-08-30 07:33:54
【问题描述】:
我想移动我的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>
那么,有什么好的方法吗?
【问题讨论】:
-
这有什么用?
-
我不确定你想要什么(ConstraintLayout 的一半)
-
@Xenolion 我已经更新了我的答案
-
这能回答你的问题吗? Position view outside of ConstraintLayout
标签: android android-layout material-design android-view android-constraintlayout