Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么蓝色和红色View的高度不一致? #7

Closed
roshanman opened this issue Jan 13, 2017 · 1 comment
Closed

为什么蓝色和红色View的高度不一致? #7

roshanman opened this issue Jan 13, 2017 · 1 comment

Comments

@roshanman
Copy link

override func viewDidLoad() {
        super.viewDidLoad()

        let S = TGRelativeLayout()
        let A = UILabel()
        let B = UILabel()

        S.tg_width.equal(300).and().tg_height.equal(300)
        
        S.backgroundColor = .yellow
        
        A.text = "Hello world"
        A.backgroundColor = .blue
        
        A.tg_left.equal(0)
        A.tg_top.equal(0)
        A.tg_height.equal(40)
        A.tg_right.equal(B.tg_left).offset(10)

        B.text = "Hello world2"
        B.backgroundColor = .red
        
        B.tg_right.equal(0)
        B.tg_top.equal(0)
        B.tg_width.equal(.wrap)
        B.tg_height.equal(40)

         S.addSubview(A)
        S.addSubview(B)
        
        view.addSubview(S)
    }

2017-01-13 14 30 34

我设置了相同的高度了

A.tg_height.equal(40)
B.tg_height.equal(40)
@youngsoft
Copy link
Owner

谢谢你的问题,我已经修复了这个BUG了。这个BUG是因为以前认为宽度是wrap高度是特定值是不可能的情况!!其实是有可能的。您可以下载最新的git代码。。后续我会在版本升级中加上changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants