Having issue on Real Device using vector image in android. SVG-android(在 android 中使用矢量图像在 Real Device 上出现问题.SVG-安卓)
问题描述
我使用 https://github.com/pents90/svg-android 中的 svg-android.jar 工作正常,但仅在 eclipse 中的模拟器设备上使用.啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊在真实设备上,它只是在屏幕上清空 imageView.这是我的代码:
I use svg-android.jar from https://github.com/pents90/svg-android at its work fine but only on emulator devices in eclipse. Agrrrr. On real devices it just empty imageView on screen.
here is my code:
SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.test);
Drawable drawable = svg.createPictureDrawable();
imgView.setImageDrawable(drawable);
有什么建议吗?
推荐答案
在默认开启硬件渲染的较新设备上,需要显式开启软件渲染.
On newer devices that have hardware rendering turned on by default, you need to explicitly turn on software rendering.
imgView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
我怀疑这可能是你的问题.
I suspect this is probably your problem.
这篇关于在 android 中使用矢量图像在 Real Device 上出现问题.SVG-安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 android 中使用矢量图像在 Real Device 上出现问题.SVG-安卓
基础教程推荐
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
