Q:

I want to add some views to UIButton, for example multiple UILabels, UIImages etc. One I add those view they do not get the touch events. How can I pass the touch events to UIButton?

Thanks

--------

A:

Set the userInteractionEnabled property of each of the subviews you added to your UIButton to NO.

Adding other views to UIButton的更多相关文章

  1. Programming Entity Framework 翻译(1)-目录

    1. Introducing the ADO.NET Entity Framework ado.net entity framework 介绍 1 The Entity Relationship Mo ...

  2. Xib的使用与File'Owner总结

    Xib的使用与File'Owner总结 一.XIB的适用范围 xib(也叫Nib)与storyboard一样是用来描述界面的. storyboard描述的是比较大型的,大范围.适合描述界面跳转等. 二 ...

  3. 【转】iOS学习之Autolayout(代码添加约束) -- 不错不错

    原文网址:http://www.cnblogs.com/HypeCheng/articles/4192154.html DECEMBER 07, 2013 学习资料 文章 Beginning Auto ...

  4. [置顶] UITableViewCell

    UITableViewCellStyle: 四种Cell类型. UITableViewCellSeparatorStyle 分割线类型.(group三种,plain两种) UITableViewCel ...

  5. 【iOS】Xib的使用与File'Owner总结

    一.XIB的适用范围 xib(也叫Nib)与storyboard一样是用来描写叙述界面的. storyboard描写叙述的是比較大型的,大范围.适合描写叙述界面跳转等. 二.XIB的使用 Xib是小范 ...

  6. Ultimate guide to learning AngularJS in one day

    What is AngularJS? Angular is a client-side MVC/MVVM framework built in JavaScript, essential for mo ...

  7. UITableView编辑模式

    UITableView有两种模式,普通模式和编辑模式.在编辑模式下可以对cell进行排序.删除.插入等等. 如何进入编辑模式 调用tableView的setEditing(editing: Bool, ...

  8. Collection View Programming Guide for iOS---(六)---Creating Custom Layouts

    Creating Custom Layouts 创建自定义布局 Before you start building custom layouts, consider whether doing so ...

  9. wesome-android

    awesome-android Introduction android libs from github System requirements Android Notice If the lib ...

随机推荐

  1. java一些jar包的bug(不定期更新)

    c3p0-0.9.5.jar 连接池jar包,常用于web项目,关闭连接池时,没有注销所有的driver 解决:可声明一个ServletContextListener的子类并设置监听,重写contex ...

  2. python使用xlrd操作Excel文件

    一.xlrd读取Excel文件 用xlrd进行读取比较方便,流程和平常手动操作Excel一样,打开工作簿(Workbook),选择工作表(sheets),然后操作单元格(cell). 例子:要打开当前 ...

  3. vue key值的重复键问题报错

    1.问题描述:在vue2.0+ 中做一个公用的评论组件,:key使用的时创建评论的时间,当加载更多的时候,会报错: Duplicate keys detected: '2019-01-24T07:15 ...

  4. 我叫mt3.2更新公告

    1.增加装备合成功能 可以用材料将现有的75级紫装升级为80级紫装. 2.增加全新公会副本 增加新的公会副本:神庙外围.掉落可以进阶装备的材料. 3.增加全新个人副本 增加新的个人副本:奴隶市场. 4 ...

  5. cogs 610. 数对的个数

    610. 数对的个数 ★★   输入文件:dec.in   输出文件:dec.out   简单对比时间限制:1 s   内存限制:128 MB Description出题是一件痛苦的事情!题目看多了也 ...

  6. 修改jq weui自定义对话框点击确定按钮不关闭对话框

    如果我们在对话框给用户输入值时,当用户输入空值点击确定按钮时,应该给个提示然后让用户继续输入. 如果在方法里使用 return false;,结果用户输入空值时对话框还是会关闭.正确做法如下: 先设置 ...

  7. 小奇的仓库(树形DP)

    「题目背景」 小奇采的矿实在太多了,它准备在喵星系建个矿石仓库.令它无语的是,喵星系的货运飞船引擎还停留在上元时代! 「问题描述」 喵星系有n个星球,星球以及星球间的航线形成一棵树. 从星球a到星球b ...

  8. Mysql 开启 Slow 慢查询

    1:登录数据库查看是否已经开启了Slow慢查询: mysql> show variables like 'slow_query%'; 2:开启Mysql slow日志: 默认情况下slow_qu ...

  9. STP-5-STP配置及分析

    拓扑: root id列出了根的网桥id为两部分,前边是优先级,后边跟着mac地址,cost 0 暗示sw1就是根: 下边的命令确认sw1就是vlan1的根: 下边,sw2配置了一个比sw1更低的优先 ...

  10. Gym - 101810F ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #def ...