在运行时更改图像源 [英] Change image source at run time

查看:28
本文介绍了在运行时更改图像源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在点击事件时更改图像.我在点击时更改图像的来源,但在触发任何其他事件时它不会立即反映出来.为什么会这样,有人有解决方案吗?

I want to change the image at click event.I change the source of the image on click but its not reflecting immediately it comes when any other event is fired.Why is it so and anyone have the solution??

推荐答案

在设置source后调用image.validateNow()立即强制更改.

Call image.validateNow() after setting the source to force the change immediately.

这篇关于在运行时更改图像源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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