UITableViewCell 中的 UIButton 是可点击的(获取正确的事件)但问题是点击效果不可见 [英] UIButton within UITableViewCell is Tappable(Getting proper event) But the issue is tap effect is not visible

查看:26
本文介绍了UITableViewCell 中的 UIButton 是可点击的(获取正确的事件)但问题是点击效果不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 UILable 和 UIButton 的自定义表格视图单元格,它工作正常我在按钮点击时获得了正确的事件,但问题是按钮的点击效果在 UI 中不可见.

I have a custom table view cell with UILable and UIButton which is working fine I am getting proper event on button tap, but the issue is tap effect of button is not visible in UI.

编辑 - 功能明智的按钮工作正常,但问题是点击时,点击效果不可见,见下图.

Edit - Functionality wise button is working fine but the issue is that on tap, tap effect is not visible see below attached image.

我期待在 tableview 单元格内的按钮具有相同的平滑触感 -

I am expecting below same smooth touch for button which is within tableview Cell -

推荐答案

将其添加到您的按钮 showsTouchWhenHighlighted 并检查一次

add this on your button showsTouchWhenHighlighted and check once

button.showsTouchWhenHighlighted = TRUE

这篇关于UITableViewCell 中的 UIButton 是可点击的(获取正确的事件)但问题是点击效果不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆