görüntülemek için constrins düğmeyi eklemek ve soru çok net olmadığı için i düğmesine ekleyip facebook soruyahızlı i tableviewCell bir görünüme sahip programlama
-2
A
cevap
1
gibi görünüm
ile bu düğme için constrins eklemek istiyorum
YOURVIEW.addSubview(YOURBUTTON)
iOS 9+
YOURVIEW.addSubview(YOURBUTTON)
YOURBUTTON.translatesAutoresizingMaskIntoConstraints = false
YOURBUTTON.topAnchor.constraintEqualToAnchor(YOURVIEW.topAnchor).active = true
YOURBUTTON.bottomAnchor.constraintEqualToAnchor(YOURVIEW.bottomAnchor).active = true
YOURBUTTON.leadingAnchor.constraintEqualToAnchor(YOURVIEW.leadingAnchor).active = true
YOURBUTTON.trailingAnchor.constraintEqualToAnchor(YOURVIEW.trailingAnchor).active = true
: i sadece bu damla olurdu
iOS 6+
let view = ["yourButotn": YOURBUTTON]
addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-[yourButotn]-|", options: [], metrics: nil, views: views))
addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-[yourButotn]-|", options: [], metrics: nil, views: views))
bu da wid oynamak istediğiniz ekran görüntüsünde görünümü işaretleyin
+0
bu ios8 veya 7'de mevcut değildir, sadece ios9 –
+0
için bu soru iOS versiyonunu şart koşmaz –
Sorunuz net değil kısıtlamaları ekleyecektir. –