android - 最新的 android studio 更新不支持百分比布局?

标签 android android-studio

在设计 View 中使用百分比布局会引发异常:Exception raised during rendering: android/support/percent/R$styleable 或 Exception raised during rendering: 8 ava.lang.ArrayIndexOutOfBoundsException: 8 在 com.android.tools.idea.rendering.AarResourceClassGenerator.generateStyleable(AarResourceClassGenerator.java:210)

之前工作过,我今天更新了:Android Studio 2.0 Build #AI 9321

有没有办法回滚更新?

 <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="match_parent">
 <ImageView
     app:layout_widthPercent="50%"
     app:layout_heightPercent="50%"
     app:layout_marginTopPercent="25%"
     app:layout_marginLeftPercent="25%"/>
 </android.support.percent.PercentRelativeLayout>

api版本应指定​​为23,因为支持版本为23.2.1

最佳答案

  1. 确保您使用的是最新版本的库。
  2. 重启 Android Studio。
  3. 构建您的项目。

问题解决了!

关于android - 最新的 android studio 更新不支持百分比布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36639334/

相关文章:

android - 实现应用程序 :hideOnScroll for BottomAppBar in Android

java - Android平台如何开启SSL调试?

android - Angular Js 和 Trigger.io - 无法点击适用于 iOS 的 Android 链接

android - 错误 : package android. support.annotation 不存在 - Android 工作室 - Gradle

android - 如何加速 Android Studio 3.0

java - 如何使用 FileProvider 访问下载文件夹?

java - 带有 Json 解析的 ArrayAdapter

java - BaseGameUtils 无法解析符号 android 在 : "com.google.android.gms.games.Games"

android - 如何判断外部库是如何添加的?

Android Studio 无法识别可绘制对象中的 9patch 图像