我尝试使用PercentFrameLayout但我收到此错误信息:PercentFrameLayout:必须提供layout_width属性
Binary XML file line #: You must supply a layout_width attribute.
这是我使用xml:
<android.support.percent.PercentFrameLayout
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="match_parent">
<ImageView
app:layout_heightPercent="50%"
app:layout_marginLeftPercent="25%"
app:layout_marginTopPercent="25%"
app:layout_widthPercent="50%"/>
</android.support.percent.PercentFrameLayout>
这是一个错误或这是我的错误吗?
这看起来和http://developer.android.com/reference/android/support/percent/PercentFrameLayout.html中的参数不同,因为我认为它是正确的。你确定这些是对问题的看法吗?如果您删除这些视图,您的布局是否正确加载? –
@CoryCharlton是的,它来自文档,是的,它是与问题的看法。 Android Studio也强调它也是一个问题。 –