0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

メモ

Posted at
スクリーンショット 2019-11-25 23.00.12.png スクリーンショット 2019-11-25 23.00.21.png

可変である上のlabelのオートレイアウトはwide上下左右に付与

スクリーンショット 2019-11-25 22.59.45.png

下のlabelはwide高さ左右に付与
下のオートレイアウト は付与しない

全体のコード

 func view() {
        let view1 = CustomView.init(frame: CGRect(x: 0, y: 0, width: 200, height: 591))
        view1.test.text = "あああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああ"
//        view1.test.sizeToFit()
        
        let height = view1.test.sizeThatFits(CGSize(width: view1.test.frame.size.width, height: CGFloat.greatestFiniteMagnitude)).height
        view1.test.heightAnchor.constraint(equalToConstant: height).isActive = true
        
        view.addSubview(view1)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?