插件XAlign的使用

来源:互联网 发布:维棠下载软件 编辑:程序博客网 时间:2024/05/18 03:54

原本:

    func Hello(){        var StrongXname = UILabel(frame: CGRectMake(50,100,300,20))//Returns a rectangle with the specified coordinate and size values.        StrongXname.text = "哈咯,大家好,我叫StrongX"        self.view.addSubview(StrongXname)//Adds a view to the end of the receiver’s list of subviews.        StrongXname.alpha = 0// The view’s alpha value. where 0.0 represents totally transparent and 1.0 represents totally opaque.        var image = UIImageView(frame: CGRectMake(50, 150, 200, 270))        image.image = UIImage(named: "cute_girl.jpg")        self.view.addSubview(image)        image.alpha = 0                UIView.animateWithDuration(5, animations: { () -> Void in            StrongXname.alpha = 1            image.alpha = 1        })    }    

shift+command+x后,代码对齐:

    func Hello(){        var StrongXname   = UILabel(frame: CGRectMake(50,100,300,20))//Returns a rectangle with the specified coordinate and size values.        StrongXname.text  = "哈咯,大家好,我叫StrongX"        self.view.addSubview(StrongXname)//Adds a view to the end of the receiver’s list of subviews.        StrongXname.alpha = 0// The view’s alpha value. where 0.0 represents totally transparent and 1.0 represents totally opaque.        var image         = UIImageView(frame: CGRectMake(50, 150, 200, 270))        image.image       = UIImage(named: "cute_girl.jpg")        self.view.addSubview(image)        image.alpha       = 0        UIView.animateWithDuration(5, animations: { () -> Void in        StrongXname.alpha = 1        image.alpha       = 1        })    }


0 0
原创粉丝点击