Why imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); and <application android:hardwareAccelerated=“false” have different effect?

自作多情 提交于 2020-01-02 03:10:28

问题


I wonder why if I set

<application
   android:hardwareAccelerated="false"

using svg-android i see no image (due to hw acceleration problem?), but if I set

imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

I can get it to work.

Does View.LAYER_TYPE_SOFTWARE disables the hw acceleration or not?


回答1:


The direct answer to your question (Does View.LAYER_TYPE_SOFTWARE disables the hw acceleration or not?) is YES. It actually disable hw acceleration, but only at a view level, i.e. hw accl is disabled in imageView in your case, while setting android:hardwareAccelerated="false" will disable hw accl for your whole application.

For more detailed, please refer this link.



来源:https://stackoverflow.com/questions/17814680/why-imageview-setlayertypeview-layer-type-software-null-and-application-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!