標籤:
LR來找我健身,她說同學都領證了,她著急,東來順,寶鼎羊肉,大碗茄子
YY秀聚餐自拍,太美啦
換產品,展書房不帶這個項目,換人,改需求,頁面大改動
準備做家庭醫生,頁面很多,加油,拼,眼睛痛就洗手間休息,閉眼,洗臉,
晚上回去必須刷牙,現在沒怎麼泡腳了,也沒怎麼coding了,
Q:Scroll 在ios7不能滾動 ios9可以滾動
A: 添加約束:
[contentScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.contentLabel.mas_bottom); // greaterThanOrEqualTo 添加的約束,解決ios7不能滾動的bug
make.height.mas_equalTo(contentLabelHeight - 2);
}];
-----------------------------------------------------------------
小藍點不能跟label對齊,原因是lable被展開了,怎麼發現的呢,給label添加紅色顏色,發現只有一行文案的時候,lable很高
解決辦法是算出字串的高度,給label添加高度約束
原因: 圖片是有大小的,label高度不能撐開圖片的話,圖片就按照自身的高度展示,label就被拉大了,當label足夠多的時候,圖片可以被撐開,
--------
------------------------------------------------------------------------------------
先調用initWithModel然後掉用 viewDidLoad
------------------------------------------------------------------------------------------------
原因是先設定了容器view的高度
[self.topWhiteView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.bgScrollView);
make.left.right.equalTo(self.view);
make.height.mas_equalTo(200); //高度自適應 test
}];
後面又添加了底部約束
[self.topWhiteView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.labelButtonView).offset(kHDFVerticalMargin);
}];
,其實約束衝突了,控制台答應了約束錯誤資訊:
Try this:
(1) look at each constraint and try to figure out which you don‘t expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<MASLayoutConstraint:0x7b7a16e0 UIView:0x79eda150.height == 200>",
"<MASLayoutConstraint:0x7b788250 UILabel:0x79eda370.top == UIView:0x79eda150.top + 20>",
"<MASLayoutConstraint:0x79ec8b50 UILabel:0x79eda370.height == 16.707>",
"<MASLayoutConstraint:0x7b7d1850 UILabel:0x7b7af810.top == UILabel:0x79eda370.bottom + 8>",
"<MASLayoutConstraint:0x7b74dbb0 UILabel:0x7b7af810.height == 16.707>",
"<MASLayoutConstraint:0x7b7c5560 UILabel:0x7b7d31e0.top == UILabel:0x7b7af810.bottom + 10>",
"<MASLayoutConstraint:0x7b7d10e0 UILabel:0x7b75ea10.height == 16.707>",
如何debug的,添加很多停診時間資料,發現並沒有撐開View,猜測是view的高度被寫死了,真是
-------
scrollView不能滾動
不用設定contentSize, 純約束就行 自訂的底部view也要設定約束:
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(commentView);
}];
[self.bgScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.bottomToTravelView); // scrollview的約束
}];
scrollView初始約束:
[_bgScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
----------
對象為nil不能加約束
5.16-停診引入出差