UIButton无法响应点击事件问题
2016-05-23 01:22
459 查看
问题描述:
当设置UIButton的backgroundColor = [UIColor clearColor]时,如果此时按钮上仅有一张图片并且按钮图片较小,如下图
![](http://img.blog.csdn.net/20160421173849855?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
‘
此时点击按钮除图片之外的位置将不会触发按钮事件,解决办法为将UIButton的backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.001]
具体原因不详
当设置UIButton的backgroundColor = [UIColor clearColor]时,如果此时按钮上仅有一张图片并且按钮图片较小,如下图
‘
此时点击按钮除图片之外的位置将不会触发按钮事件,解决办法为将UIButton的backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.001]
具体原因不详
相关文章推荐
- 频繁修改UIButton的文字引起的频闪问题解决办法
- require,include,require_once,include_once的区别
- LeetCode 96. Unique Binary Search Trees(唯一二叉树)
- LeetCode 95. Unique Binary Search Trees II(唯一二叉搜索树)
- java保存到数据库中文乱码,加useUnicode=true&characterEncoding=UTF-8
- use java code to cheng the layout of the UI
- 队列 Queue 与双端队列 Deque
- [基础]iOS UI测试
- UITableView--单组数据显示(纯手动代码实现)
- UITableView的性能优化
- iOS中的UITableView
- iOS中的UITableView自定义Cell(模仿新浪微博)
- Rebuild Instance 操作详解 - 每天5分钟玩转 OpenStack(37)
- 【2016杭电女生赛1010】【旅行商问题DP + 贪心】Ingress 最多走L距离 最多hackK次 的最大得分
- Arduino 101 IMU测试及问题
- bzoj4059【Cerc2012】Non-boring sequences
- Windows Server 2012 GUI与Core的切换
- hdu 2604 Queuing(矩阵优化DP)
- Android UI(Layouts)-RelativeLayout详解
- 5. soapui 测试