简体   繁体   English

Android Studio渲染问题,

[英]Android studio rendering problems,

I have seen this answer My question is not for specific 'Rendering problem' but any 'Rendering problem' and I don't want to reduce my designer preview API level too. 我已经看到了这个答案我的问题不是针对特定的“渲染问题”,而是针对任何“渲染问题”,我也不想降低我的设计器预览API级别。 I want to know why is this error shown. 我想知道为什么显示此错误。 And, mostly after updating 'Android Studio'. 而且,主要是在更新了“ Android Studio”之后。 For now, this 'Rendering problem' was shown with following description: 现在,此“渲染问题”已显示为以下描述:

 The following classes could not be instantiated:
 android.support.design.widget.FloatingActionButton (Open Class, Show Exception, Clear Cache)
 Tip: Use View.isInEditMode()
 ...
 ...

Any proper solution, considering subsequent updates? 考虑到后续更新,是否有适当的解决方案?

Solution: Update 'Android SDK' (preferably by running 'SDK Manager.exe'). 解决方案:更新“ Android SDK”(最好通过运行“ SDK Manager.exe”)。 Tick all the packages and install them all. 勾选所有软件包并全部安装。

SDK Manager.exe is buggy. SDK Manager.exe有错误。 While the tools are downloaded, many of times it will show downloading errors. 下载工具时,很多时候它将显示下载错误。 Errors in downloading this and errors in downloading that and stops downloading or skips that item. 下载错误,下载错误,并停止下载或跳过该项目。 If all the updates and packages required in new API level are not downloaded, a 'Rendering problem' will be shown. 如果未下载新API级别所需的所有更新和软件包,则将显示“渲染问题”。 We generally don't check whether SDK is up-to-date or no. 我们通常不检查SDK是否是最新的。 Thus such errors are thrown. 因此抛出了这样的错误。 For me, till today, SDK hasn't updated on a single click. 对我来说,直到今天,SDK都没有一次单击即可更新。 I have to retry it multiple times to update the full SDK. 我必须重试多次以更新完整的SDK。

I would like to add a quick fix for a rendering problem i had, for android studio beginners like me. 我想为像我这样的android studio初学者添加一个快速解决我遇到的渲染问题的方法。 Some references to dimensions, styles or strings could not be resolved, so it would show things like "@strings/some_string" instead of the actual text. 对尺寸,样式或字符串的某些引用无法解析,因此将显示诸如“ @ strings / some_string”之类的内容,而不是实际的文本。
I fixed my rendering problems by clicking Refresh on the upper right side of the design view. 我通过单击设计视图右上角的“ 刷新”解决了渲染问题。

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

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