Android开发AndroidAndroid开发

Android 5.0 ripple 标签

2018-12-28  本文已影响14人  sydMobile

在 5.0 后加入了 ripple 标签,使用这个 Drawable 做控件的背景,在点击的时候就可以达到 波浪的效果。

ripple 标签对应的是一个 rippleDrawable ,当使用它作为背景的时候,在控件按下去的时候,就会显示水波效果。

ripple 主要有两种形式

在 5.0 之前 forground = ?attr/selectableItemBackground 可以实现波纹效果

上一篇 下一篇

猜你喜欢

热点阅读