SnapKit/Masonry

Add Hugging and CompressionResistance Please

Open

#344 建立於 2016年5月18日

在 GitHub 查看
 (9 留言) (16 反應) (0 負責人)Objective-C (3,153 fork)batch import
enhancementhelp wanted

倉庫指標

Star
 (18,166 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I want to add hugging constraint to a view now, but it is not elegant code to write so

[self.footTitleSignBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.left.equalTo(self.footView);
    make.centerY.equalTo(self.footView.mas_centerY).offset(0);
}];
[self.footTitleSignBackgroundView setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[self.footTitleSignBackgroundView setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];

I think you should add this syntax into Masonry

make.horizontal.huggingRequired()
make.horizontal.huggingHigh()
make.horizontal.huggingFittingSizeLevel()
make.horizontal.huggingLow()
make.vertical...
make.horizontal.compressionResistance...
make.vertical.compressionResistance...

貢獻者指南