bir UITableViewCell
alt sınıfı initWithStyle:reuseIdentifier:
yöntem içinde bu kısıtlamalar oluşturma:Kısıtlama neden durum
UIVisualEffectView
sınırlamak için gerekiyordu
[self.visualEffectView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[visualEffectView(50)]|" options:0 metrics:nil views:@{@"visualEffectView" : self.visualEffectView}]];
ve hücrenin altına yapışır.
Ancak, doğru olan ama bu duruma neden olur: eş zamanlı kısıtlamaları karşılamak için açılamıyor
.
Will attempt to recover by breaking constraint <NSLayoutConstraint:0x15c7783b0 UIVisualEffectView:0x15c5ae220.top == CustomCell:0x15c5ac140'cell'.topMargin>
yanlış burada ne yapıyorum?
setup
initWithStyle:reuseIdentifier:
-(void)setup
{
self.profileImageView = [UIImageView new];
self.profileImageView.contentMode = UIViewContentModeScaleToFill;
self.visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
[self addSubview:self.profileImageView];
[self addSubview:self.visualEffectView];
[self.profileImageView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self.visualEffectView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[profileImageView]|" options:0 metrics:nil views:@{@"profileImageView" : self.profileImageView}]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[profileImageView]|" options:0 metrics:nil views:@{@"profileImageView" : self.profileImageView}]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[visualEffectView]|" options:0 metrics:nil views:@{@"visualEffectView" : self.visualEffectView}]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[visualEffectView(50)]|" options:0 metrics:nil views:@{@"visualEffectView" : self.visualEffectView}]];
çağrılır GÜNCELLEME}
Tam hata iletisi:
"(
"<NSLayoutConstraint:0x12c5b2c40 UIVisualEffectView:0x12c753b90.top == CustomCell:0x12c751bb0'cell'.topMargin>",
"<NSLayoutConstraint:0x12c5b2ec0 V:[UIVisualEffectView:0x12c753b90(50)]>",
"<NSLayoutConstraint:0x12c5b2f10 V:[UIVisualEffectView:0x12c753b90]-(0)-| (Names: '|':CustomCell:0x12c751bb0'cell')>",
"<NSLayoutConstraint:0x12c5ba110 'UIView-Encapsulated-Layout-Height' V:[CustomCell:0x12c751bb0'cell'(250)]>"
)"
ile
değiştirin. Lütfen bunları ve tüm hatayı konsoldan da gönderin. – Jelly
@Jelly şimdi yüklendi – Erik
'VisualEffectView' hücresinde dikey olarak ortalanmasını istiyorsunuz? – Jelly