• iphone/ipad实现自定义的开关UISwitch(continuous,clipsToBounds,userInteractionEnabled属性)


    这里主要讲几个UIView的几个属性,具体大家可以下载代码看看,

    下载地址是:

    http://download.csdn.net/detail/rhljiayou/5960003

    实现效果是:

    代码中有设计到几个我不常用的属性:

    @property(nonatomic,getter=isContinuous) BOOL continuous;        // if set, value change events are generated any time the value changes due to dragging. default = YES

    这个是UISlider当中的一个属性,作用是,当你拖动轨迹按钮的时候,如果这个属性是yes,那么它就会处发sliderValueChanged方法,设为no就拖动的时候不会处发。

    如果想处发sliderValueChanged方法,那就用        [self sendActionsForControlEvents:UIControlEventValueChanged];

    @property(nonatomic)                 BOOL              clipsToBounds;              // When YES, content and subviews are clipped to the bounds of the view. Default is NO.

    这个是UIView当中的一个属性,作用是,view如果超出了父视图的界线,可以用这个来显示遮挡的部分,设为yes为遮挡住,默认为no不遮挡。

    @property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;  // default is YES. if set to NO, user events (touch, keys) are ignored and removed from the event queue.

    这个是UIView当中的一个属性,比如窗口中有一个UIButton按钮,然后我在上面又添加了一个UIView盖在uibutton上面,那么这个UIButton按钮就得不到响应,为了使这个按钮得到响应,应该设置这个属性为no,默认的是yes。


    ok!微笑

  • 相关阅读:
    SQLSERVER 中GO的作用
    工作相关工具介绍
    SQL Server 没有足够的内存继续执行程序 (mscorlib)的解决办法
    glyphicons-halflings-regular.woff2 not found 前台错误修正
    Asp.net MVC Pager分页实现
    金融相关网站
    Excel 函数使用
    C# 使用 Invoke 实现函数的白盒 UT 测试
    反编译工具
    SQL Server 数据库修改后不允许保存
  • 原文地址:https://www.cnblogs.com/james1207/p/3262812.html
Copyright © 2020-2023  润新知