Heyho队友,的Android ConstraintLayout @dimens替换硬编码值
目前我正在学习Android Studio中的新布局编辑器新ConstraintLayout。
顺便说一句,我讨厌它。
但我得到的问题,如果我想指定与@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>
也恰好外面滚动视图。
后的XML代码在这里,您 –
并不真正需要明确的代码行,它发生在任何地方.. – PadySo
点击属性的DP值。并检查维度。 –