与
@H_502_16@解决方法
PercentRelativeLayout
的观点我试图达成16:9的宽高比.
所以我把这一行放在我的build.gradle文件中:compile’com.android.support:design:23.0.1′
我用这个布局:
- <android.support.percent.PercentRelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <ImageView
- android:layout_width="match_parent"
- app:layout_aspectRatio="178%"
- android:scaleType="centerCrop"/>
- </android.support.percent.PercentRelativeLayout>
问题:
> Android Studio警告我:应该为ImageView定义’layout_height’.
>当我运行我的项目我得到:错误:(15)没有找到属性“layout_aspectRatio”的资源标识符.
那怎么了?