Heyho伙伴,
目前我正在使用新的ConstraintLayout学习Android Studio 的新布局编辑器.
顺便说一句,我讨厌它.
但是我遇到了问题,如果我想用@dimen指定layout_height,它会被替换为dp值.
有人得到了这个问题吗?
Android Studio版本2.2.2和2.2.3相同的问题.
最新的gradle版本.
先谢谢你们!
编辑:
代码示例:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="@dimen/imageViewHeight"
app:srcCompat="@drawable/accept"
android:id="@+id/imageView"
android:layout_marginStart="16dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
也在scrollview外面发生.