質問編集履歴
1
追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -74,5 +74,25 @@
|
|
74
74
|
|
75
75
|
|
76
76
|
### 補足情報(FW/ツールのバージョンなど)
|
77
|
+
xcode9.2
|
77
78
|
|
79
|
+
### 回答に対する補足
|
80
|
+
|
81
|
+
let postLabel = UILabel()
|
82
|
+
postLabel.text = "投稿"
|
83
|
+
postLabel.frame = CGRect(x: 0, y:0, width:100, height:21)
|
84
|
+
postLabel.textAlignment = .center
|
85
|
+
postLabel.textColor = UIColor.lightGray
|
86
|
+
postLabel.font = UIFont.boldSystemFont(ofSize: 12)
|
87
|
+
myPageView.addSubview(postLabel)
|
88
|
+
|
89
|
+
postLabel.translatesAutoresizingMaskIntoConstraints = false
|
90
|
+
postLabel.widthAnchor.constraint(
|
91
|
+
equalTo: self.view.widthAnchor,
|
78
|
-
|
92
|
+
multiplier: 0.25
|
93
|
+
).isActive = true
|
94
|
+
|
95
|
+
上記のように2つのUILabelに対してautoLayoutも試しましたが、下記のように空白になってしまいます。
|
96
|
+

|
97
|
+
|
98
|
+
おそらく記載方法の誤りがあると思うのですが、原因がわかりましたらご教授いただけましたら幸いです。
|