7月26日

作者: 唯一的信仰 | 来源:发表于2016-07-27 19:36 被阅读12次

    UILabel的属性总结

    文字自动换行属性

    1.lineBreakModes

    UItableViewCell的属性

    cell.selectionStyle = UITableViewCellSelectionStyle.None // 取消默认被选择中为灰色的样式

    如何在App中简单实现夜间模式

    1. 定义一个UIView,将View的大小设置为屏幕大小

    2.将View的与用户交互触摸事件关闭,因为默认UIView可以响应触摸事件

    3.将View添加到UIWindow类上

    4.根据事件响应链的原则,如果自己不能响应事件,就交由父类视图响应事件

    实现代码

    // 拿到屏幕的宽和高

    let width = UIScreen.MainScreen.bounds.width

    let height =  UIScreen.MainScreen.bounds.height

    let view = UIView(frame:CGRectMake:(0,0,width,height))

    view.backgroundColor = bicolor(white:0,alpha:0.2)

    // 拿到代理对象

    let delegate = UIApplication.sharedApplication().delegate

    // 将View添加到代理的主窗口上

    delegate.window.addSubView(View)

    相关文章

      网友评论

          本文标题:7月26日

          本文链接:https://www.haomeiwen.com/subject/wenojttx.html