How are you setting the images for the different UIControlStates on the button? Are you setting a background image for UIControlStateHighlighted as well as UIControlStateSelected?

UIImage *someImage = [UIImage imageNamed:@"SomeResource.png"];
[button setBackgroundImage:someImage forState:UIControlStateHighlighted];
[button setBackgroundImage:someImage forState:UIControlStateSelected];

If you're setting the selected state on the button touch down event rather than touch up inside, your button will actually be in a highlighted+selected state, so you'll want to set that too.

[button setBackgroundImage:someImage forState:(UIControlStateHighlighted|UIControlStateSelected];

Edit:

To sum up my remarks in the comments and to address the code you posted...you need to set your background images for the full UIControl state that you're in. According to your code snippet, this control state would be disabled+selected+highlighted for the duration of the network operation. This means that you would need to do this:

[button setBackgroundImage:someImage forState:(UIControlStateDisabled|UIControlStateHighlighted|UIControlStateSelected];

If you remove the highlighted = YES, then you would need this:

[button setBackgroundImage:someImage forState:(UIControlStateDisabled|UIControlStateSelected];

http://stackoverflow.com/a/1785059

让UIButton在按下时没有高亮效果的更多相关文章

  1. UIButton 之 按下高亮

    设置高亮 [btn setHighlighted:YES]; 设置按下时高亮 [btn setShowsTouchWhenHighlighted:YES];

  2. UI-切圆角、透明度、取消按钮点击高亮效果、按钮文字带下划线

    一.切UIView的某个角为圆角 如果需要将UIView的4个角全部都为圆角,做法相当简单,只需设置其Layer的cornerRadius属性即可(项目需要使用QuartzCore框架).而若要指定某 ...

  3. UITableView或UIScrollVIew上的UIButton的高亮效果

    UITableView或UIScrollVIew上的UIButton的高亮效果 原文地址:http://www.jianshu.com/p/b4331f06bd34 最近做项目的时候发现,UIScro ...

  4. 动画的button(按下时缩小,松开时恢复)

    #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @pr ...

  5. 发布.net 4.0的站点到IIS7.5下时无法访问

    现象: 初始发布.net 4.0站点到IIS7.5下时,各种配置都完毕的情况下依旧无法访问.首页显示站点目录结构(注:开启目录结构访问后会显示这个错误,否则会提示开启),访问次级目录提示:Handle ...

  6. #748 – 获得按下时对应位置点的大小(Getting the Size of a Contact Point during Raw Touch)

    原文:#748 – 获得按下时对应位置点的大小(Getting the Size of a Contact Point during Raw Touch) 原文地址:https://wpf.2000t ...

  7. keydown([[data],fn]) 当键盘或按钮被按下时,发生 keydown 事件。

    keydown([[data],fn]) 概述 当键盘或按钮被按下时,发生 keydown 事件. 注释:如果在文档元素上进行设置,则无论元素是否获得焦点,该事件都会发生.直线电机滑台 参数 fnFu ...

  8. MouseMoveEvent为了不太耗资源在默认状态下是要鼠标按下才能捕捉到。要想鼠标不按下时的移动也能捕捉到,需要setMouseTracking(true)

    最近用Qt软件界面,需要用到mouseMoveEvent,研究了下,发现些问题,分享一下. 在Qt中要捕捉鼠标移动事件需要重写MouseMoveEvent,但是MouseMoveEvent为了不太耗资 ...

  9. myecplise上将工程部署到应用下时,经常出现 An internal error occurred during: "Add Deployment". java.lang.NullPointEx

    myecplise上将工程部署到应用下时,经常出现 An internal error occurred during: "Add Deployment". java.lang.N ...

随机推荐

  1. [100]linux输入输出重定向

    一目了然版本: &号含义: 参考 参考:非常经典,值得一看,我是在linux爱好者公众号里发现的. 下面是我自己的一些总结. linux的命令数据流 在Linux下,当一个用户进程被创建的时候 ...

  2. MSSQLid清零

    truncate table [cellphone2016].[dbo].[tp_phone_9]

  3. leetcode ---双指针+滑动窗体

    一:Minimum Size Subarray Sum(最小长度子数组的和O(N)) 题目: Given an array of n positive integers and a positive ...

  4. 基于Harbor和CephFS搭建高可用Private Registry

    我们有给客户搭建私有容器仓库的需求.开源的私有容器registry可供选择的不多,除了docker官方的distribution之外,比较知名的是VMware China出品的Harbor,我们选择了 ...

  5. 网络编程----------SOCKET编程实现简单的TCP协议

    首先我们须要大致了解TCP的几点知识: 1.TCP的特点:面向连接的可靠性传输 2.TCP的三次握手建立连接和四次挥手释放连接.但为什么TCP要三次握手建立连接呢? 答:由于两次握手无法保证可靠性.若 ...

  6. MYSQL COST optimizer

    http://blog.chinaunix.net/uid-26896862-id-3326400.html https://www.slideshare.net/olavsa/mysql-optim ...

  7. Oracle行转列SQL

      -- Create table /*create table TEST_TABLE ( STUDENT VARCHAR2(200), SUBJECT VARCHAR2(200), GRADE NU ...

  8. vim添加复制(crtl+c),粘贴(ctrl+v)ctrl+A 等快捷键

    1  在  /usr/share/vim/vimrc文件中添加   source $VIMRUNTIME/mswin.vim 2  mswin.vim位置在 /usr/share/vim/vim72/ ...

  9. 一款由css3和jquery实现的卡面折叠式菜单

    之前已经为大家介绍了好多导航菜单.今天为大家再带来一款由css3和jquery实现的卡片折叠式菜单.当菜单关闭的时候,有三维堆叠的效果.我们一起看下效果图: 在线预览   源码下载 html代码: & ...

  10. PHP empty(),isset()与is_null()的实例测试

    测试的类型如下: <?php $a; $b = false; $c = ''; $d = ; $e = null; $f = array(); ?>   empty() 首先是empty的 ...