【发布时间】:2017-03-12 07:27:41
【问题描述】:
我有一个由程序添加的图像视图:
imagen = new ImageView(getApplicationContext());
现在我想对此应用涟漪效应。 我有涟漪效应库:
<com.skyfishjy.library.RippleBackground
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/content"
app:rb_color="#0099CC"
app:rb_radius="32dp"
app:rb_rippleAmount="4"
app:rb_duration="3000"
app:rb_scale="6">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_centerInParent="true"
android:id="@+id/centerImage"
android:src="@drawable/demoImage"/>
</com.skyfishjy.library.RippleBackground>
在上面的代码中,我在 XML 中有图像视图,但我的图像视图是在运行时创建的,所以我如何将波纹效果应用于运行时 Imageview
【问题讨论】:
标签: android android-layout android-view android-xml ripple