为什么选择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?

查看:1206
本文介绍了为什么选择imageView.setLayerType(View.LAYER_TYPE_SOFTWARE,null);和< application android:hardwareAccelerated =“ false”有不同的效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么要设置

<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);和&lt; application android:hardwareAccelerated =“ false”有不同的效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆