Tag: rippledrawable

RippleDrawable – 以编程方式显示波纹效果

我有这样的观点 和ripple.xml一样 一切都很好。 当我触摸视图时,它会给我带来涟漪效应。 我正在寻找的是重复从代码开始视图上的波纹动画。 将其显示为不确定的进展。 波浪一直在荡漾。 就像是 Runnable runnable = new Runnable() { @Override public void run() { RippleDrawable drawable = (RippleDrawable) button.getBackground(); drawable.showRipples(true, true); // <– This is needed handler.postDelayed(runnable, 500); } }; 知道怎么做吗?