質問編集履歴
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -150,6 +150,46 @@
|
|
150
150
|
|
151
151
|
### 補足情報(FW/ツールのバージョンなど)
|
152
152
|
|
153
|
+
xcode9.2
|
153
154
|
|
154
155
|
|
156
|
+
|
157
|
+
### 回答に対する補足
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
let postLabel = UILabel()
|
162
|
+
|
163
|
+
postLabel.text = "投稿"
|
164
|
+
|
165
|
+
postLabel.frame = CGRect(x: 0, y:0, width:100, height:21)
|
166
|
+
|
167
|
+
postLabel.textAlignment = .center
|
168
|
+
|
169
|
+
postLabel.textColor = UIColor.lightGray
|
170
|
+
|
171
|
+
postLabel.font = UIFont.boldSystemFont(ofSize: 12)
|
172
|
+
|
173
|
+
myPageView.addSubview(postLabel)
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
postLabel.translatesAutoresizingMaskIntoConstraints = false
|
178
|
+
|
179
|
+
postLabel.widthAnchor.constraint(
|
180
|
+
|
181
|
+
equalTo: self.view.widthAnchor,
|
182
|
+
|
155
|
-
|
183
|
+
multiplier: 0.25
|
184
|
+
|
185
|
+
).isActive = true
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
上記のように2つのUILabelに対してautoLayoutも試しましたが、下記のように空白になってしまいます。
|
190
|
+
|
191
|
+
![イメージ説明](cf9bf1e5db349c846d471026b4a3981c.png)
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
おそらく記載方法の誤りがあると思うのですが、原因がわかりましたらご教授いただけましたら幸いです。
|