ios9中 UIStackView的使用

2015-06-28 0 957
ios9中 UIStackView的使用
UIStackView可以垂直或水平排布多个subview,
自动为每个subview创建和添加Auto Layout constraints.

1.添加subview
let logoImage:UIImageView = UIImageView(image: UIImage(named: "logo"))

logoImage.contentMode = .ScaleAspectFit

self.stackView.addArrangedSubview(logoImage)

UIView.animateWithDuration(0.25, animations: {

    self.stackView.layoutIfNeeded()

})

2.删除subview
self.stackView.removeArrangedSubview(logoView)

遇见资源网 objective-c ios9中 UIStackView的使用 http://www.ox520.com/17965.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务