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值。並檢查維度。 –