Android 应指定 PercentRelativeLayout 宽度和高度

Android PercentRelativeLayout width and height should be specified

我正在尝试使用 android.support.percent.PercentRelativeLayout:

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.percent.PercentRelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white">

    <ImageView
                app:layout_widthPercent="70%"
                app:layout_aspectRatio="1000%"
                app:layout_marginTopPercent="15%"
                android:layout_centerHorizontal="true"
                android:src="@drawable/logo"/>
    </android.support.percent.PercentRelativeLayout>
</ScrollView>

Android Studio 给我错误:

"layout_height should be specified
"layout_width should be specified"

Project is building now, but studio shows errors and do not suggest autocompletion when I start typing "percent..."

我做错了什么?

Here is 来自官方网站的示例,为什么它不起作用?

这里回答了问题:

基本上; PercentRelativeLayout 会忽略宽度和高度,但您需要将它们设置为 0dp,因为 Android Studio 希望它们在此处。