为什么选择imageView.setLayerType(View.LAYER_TYPE_SOFTWARE,null);和< application android:hardwareAccelerated =“ false”有不同的效果? [英] Why imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); and <application android:hardwareAccelerated="false" have different effect?
问题描述
我想知道为什么要设置
<application
android:hardwareAccelerated="false"
使用 svg-android 我没有看到图像(由于硬件加速问题?),但是如果我设置了
using svg-android i see no image (due to hw acceleration problem?), but if I set
imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
我可以使用它。
View.LAYER_TYPE_SOFTWARE
是否禁用硬件加速?
推荐答案
您问题的直接答案
(是否
View.LAYER_TYPE_SOFTWARE
会禁用硬件加速还是
不是?)
(Does
View.LAYER_TYPE_SOFTWARE
disables the hardware acceleration or not?)
是。
它实际上禁用硬件加速,但仅在视图级别禁用,即在您的情况下,在 ImageView
中禁用硬件加速,同时设置 android:hardwareAccelerated = false
将禁用整个应用程序的硬件加速。
It actually disable hardware acceleration, but only at a view level, i.e. hardware acceleration is disabled in ImageView
in your case, while setting android:hardwareAccelerated="false"
will disable hardware acceleration for your whole application.
有关详细信息,请参阅此链接。
For more detailed, please refer this link.
这篇关于为什么选择imageView.setLayerType(View.LAYER_TYPE_SOFTWARE,null);和< application android:hardwareAccelerated =“ false”有不同的效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!