在android中触摸时使用圆形选择器创建图像视图

时间:2016-04-29 14:26:43

标签: android

我需要创建imageview(或任何其他控件)并在用户触摸时实现循环选择器。我在Whatsapp等许多应用中看到过它。这是一个应用程序的示例截图,它解释了我的意思。请帮助。感谢。

enter image description here

1 个答案:

答案 0 :(得分:0)

在layout.xml中,您必须使用

注释可点击的视图
.post-like {
    height: 100px;
    position: relative;
    display: table-cell;
    vertical-align: middle;
    width: auto;
    cursor: pointer;
    font-weight: 400;
    line-height: 25px;
}

表示您描述的效果。但是,它仅适用于API 21及更高版本的设备。对于低于API 21的设备,您可以使用:

android:foreground="?android:attr/selectableItemBackgroundBorderless"