【发布时间】:2015-09-21 05:37:24
【问题描述】:
我正在使用来自这里的a linkcom.andexert.library.RippleViewlibrary
它的工作,但不像预期的那样。涟漪效应出现较晚,即;当我点击 TextView 时,Activity 会启动,然后在之前的活动的 TextView 上会出现涟漪效果。
还显示错误“无法解析方法 setOnRippleCompleteListener()”
xml文件
<com.andexert.library.RippleView
android:id="@+id/ripple_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rv_centered="true"
android:padding="0dp"
android:layout_alignParentBottom="true">
<com.techmorphosis.Utils.TextViewCustomFont
android:id="@+id/txt_lets_go"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white_text"
android:background="@drawable/purple_button_bg"
android:gravity="center"
android:padding="10dp"
android:text="@string/lets_go"
android:textSize="@dimen/textsize_medium" />
</com.andexert.library.RippleView>
java 文件
rippleView.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
// @Override
public void onComplete(RippleView rippleView) {
Log.d("Sample", "Ripple completed");
}
});
【问题讨论】:
-
告诉我们你如何初始化
rippleView变量 -
rippleView = (RippleView) findViewById(R.id.ripple_view);
-
我在等你的回复:(
-
我没有看到任何问题。确保你已经导入了正确的包。
-
编译 'com.github.traex.rippleeffect:library:1.2.3' 这是我正在处理的包