我正在尝试使用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..."
我究竟做错了什么?
这是来自官方网站的示例,为什么它不起作用?