Comments (3)
I assume loginview
and loginCompanyViewController.view
are the same view? Anyway, this doesn't work because you already defined the view's vertical position with this line:
make.top.equalTo(@(kLoginContainerYPosition));
And then you are creating additional vertical position constraint, centerY
, which, I guess, results in a conflict. What you probably want to do is something like this:
- (void)keyboardWillBeShown {
[loginCompanyViewController.view mas_remakeConstraints:^(MASConstraintMaker *make) {
CGFloat kContentPaddingForIPad = kLoginContainerYPosition - 100;
make.centerY.equalTo(@(kContentPaddingForIPad));
make.centerX.equalTo(self.view.mas_centerX);
make.width.equalTo(@(kLoginContainerViewWidth));
make.height.equalTo(@(kLoginContainerViewHeight));
}];
}
from masonry.
Hey @nickynick I'm not able to access remake constraints method and yes loginview and loginCompanyViewController.view are same.
from masonry.
You must be using an older version of Masonry, mas_remakeConstraints:
has been added in 0.5. It removes all previously installed constraints, which is convenient in cases like this.
Another possible approach is saving the constraint in a property and uninstalling it later:
self.loginViewVerticalPositionConstraint = make.top.equalTo(@(kLoginContainerYPosition));
...
[self.loginViewVerticalPositionConstraint uninstall];
[loginCompanyViewController.view mas_makeConstraints:^(MASConstraintMaker *make) {
self.loginViewVerticalPositionConstraint = make.centerY.equalTo(@(kContentPaddingForIPad));
}];
from masonry.
Related Issues (20)
- equalTo(@[@10,@30]),What is the meaning of using an array in parentheses of equalTo HOT 2
- tableViewHeaderView & textView HOT 1
- Snap
- Duplicate keys for NSLayoutAttributeBaseline and NSLayoutAttributeLastBaseline in NSLayoutConstraint+MASDebugAdditions.m HOT 1
- mas_
- instance method conflicts with same method from another category 警告
- Version 1.1.0 in Mapping to The Old Code, not The Newest Code ! HOT 3
- swift package!!!! HOT 1
- 'MASConstraint' with definition in module 'Masonry.MASConstraint' has different definitions in different modules; first difference is this method
- 缩小控件高度的动画 控件会错位平移
- Label 使用label.numberOfLines来切换行数,上下文会莫名多出来一部分空白 HOT 1
- the newest version is 1.1.0 , but the 1.1.0 is not newest code compare with the branch of master HOT 1
- 小数
- mas_equalTo crash!!!
- Is there a release plan for a new version?
- [self.installedView addConstraint:layoutConstraint]; 这句代码偶发崩溃
- ~/Library/Developer/Xcode/UserData/CodeSnippets HOT 1
- When the parent view does not add a constraint or set a frame, the child view sets a constraint with a warning.
- [MASConstraintMaker install] Crash occasionally online HOT 2
- 苹果新政策要求三方库添加隐私清单PrivacyManifest,能否支持一下? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from masonry.