简体   繁体   English

Android Studio无法呈现FloatingActionButton

[英]Android Studio cannot render FloatingActionButton

I'm just now learning how to develop in Android Studio and this error come up when I began my helloworld tutorial: 我刚刚学习如何在Android Studio中开发,当我开始我的helloworld教程时出现了这个错误:

Rendering Problems The following classes could not be instantiated: - android.support.design.widget.FloatingActionButton 呈现问题以下类无法实例化: - android.support.design.widget.FloatingActionButton

The exception details are: 例外细节是:

android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1080029 android.content.res.Resources $ NotFoundException:无法找到资源ID#0x1080029

I'm using version 23.2.0 of the Android Support Design library. 我正在使用Android支持设计库的23.2.0版。

How can I get the FloatActionButton to render in the preview pane? 如何在预览窗格中显示FloatActionButton?

http://i.stack.imgur.com/knyFA.png

Look at the error stack trace generated by the previewer. 查看预览器生成的错误堆栈跟踪。 It says it cannot find a drawable resource by id 0x1080029. 它说它找不到id 0x1080029的可绘制资源。 Does a drawable exist by that ID? 该ID是否存在可绘制的内容? Are you supplying an invalid ID? 您提供的是无效身份证件吗? On my system it appears resources start at 0x7f010000. 在我的系统上,资源似乎从0x7f010000开始。

Also found this: Android Studio FloatingActionButton error . 还发现了这个: Android Studio FloatingActionButton错误 It says there could be a bug in version 23.2.0 of the support design lib and that downgrading to 23.1.0 fixes it. 它说支持设计库的版本23.2.0中可能存在错误,并且降级到23.1.0会修复它。

Upgrade to Android Support Library version 23.2.1 resolves the issue. 升级到Android支持库版本23.2.1可以解决此问题。 It's already available in Android Studio SDK manager. 它已在Android Studio SDK管理器中提供。

There appears to be a bug in version 23.2.0 of the Android Support libraries; Android支持库的版本23.2.0中似乎存在错误; simply downgrading to 23.1.1 and rebuilding your project should make the problem disappear. 只需降级到23.1.1并重建项目应该会使问题消失。

Note that the problem is not just in the Design library; 请注意,问题不仅出现在设计库中; also the AppCompat widgets cause problems for AppCompatButton and AppCompatImageButton also give similar errors reporting missing resources. AppCompat小部件也会导致AppCompatButton出现问题,而AppCompatImageButton也会报告丢失资源的类似错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM