Could not find RippleDrawable

后端 未结 2 919

I want to create a ripple dynamically in code.

Code:

if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      buyButton.setBack         


        
2条回答
  •  粉色の甜心
    2020-11-30 11:55

    The issue is that you need to return a Drawable instead of a RippleDrawable in getPressedColorRippleDrawable. Otherwise, on pre-lollipop devices, you will get a VerifyError.

提交回复
热议问题