我正在使用AndroidSVG动态放置呈现为 svg 的签名,以显示到ImageView
.
这是我的代码:
SVG svg = SVG.getFromString(singleEmployee.signature);
ImageView image_view = (ImageView) layout_signature.findViewById(R.id.toolboxtalk_signature_svg);
image_view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
image_view.setTag(String.format(Locale.US, "employee_signature%d", x));
Drawable drawable = new PictureDrawable(svg.renderToPicture());
image_view.setImageDrawable(drawable);
我的问题是,如何在代码执行SVG
的ImageView
后期摆脱困境。
这是我正在尝试的:
ViewGroup v1 = (ViewGroup) findViewById(R.id.job_ticket_form);
ImageView signatureImageView = (ImageView) v1.findViewWithTag("employee_signature1");
PictureDrawable pictureDrawable = (PictureDrawable) signatureImageView.getDrawable();
Picture picture = pictureDrawable.getPicture();
Context context = signatureImageView.getContext();
String employeeSigSVGString = null;
try {
SVG svg = SVG.getFromResource(signatureImageView.getContext(), R.id.toolboxtalk_signature_svg);
employeeSigSVGString = spinner_value + "|" + svg;
} catch (SVGParseException e) {
e.printStackTrace();
}
任何想法如何摆脱SVG
困境ImageView
?