V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
mercurylanded
V2EX  ›  iDev

ios里alpha值为0的控件响应

  •  
  •   mercurylanded · 2012-03-13 14:18:08 +08:00 · 4646 次点击
    这是一个创建于 4428 天前的主题,其中的信息可能已经有所发展或是发生改变。
    应客户的蛋疼要求把tabbar上面的元素当做button用,不想手写一个tabbar,所以偷懒在tabbar上面盖了一几个button把alpha值设为0。但是点击之后没效果相当于点到后面的tabbar上面去了,alpha值为0.1的时候还有效的。
    3 条回复    1970-01-01 08:00:00 +08:00
    ytzong
        1
    ytzong  
       2012-03-13 17:10:14 +08:00
    拖一个 button
    改 type 为 custom
    再改下宽高就可以了吧
    lex
        2
    lex  
       2012-03-13 17:20:10 +08:00
    可以建个 UIView,
    userInteractionEnabled = YES
    alpha 不改,默认 1.
    backgroundColor = [UIColor clearColor]
    然后用 drawRectBlock 在里面填充 [[UIColor colorWithWhite:1. alpha:.0001] CGColor]
    laihj
        3
    laihj  
       2012-03-13 17:46:58 +08:00
    [UIColor clearColor]能用
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1376 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:28 · PVG 01:28 · LAX 10:28 · JFK 13:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.