[问题] 翻转后改变constraint的priority当机

楼主: duckscorpion (歆)   2017-07-13 11:43:24
想借由在程式更改ConstraintBottom.priority变更View位置
不过都会遇到当机状况无法解决
@property (strong, nonatomic) IBOutlet NSLayoutConstraint
*pageBarConstraintBottom;
- (void)statusBarOrientationChange:(NSNotification *)notification{
UIInterfaceOrientation orientation = [[UIApplication sharedApplication]
statusBarOrientation];
if ( (orientation == UIInterfaceOrientationLandscapeRight) ||
(orientation ==UIInterfaceOrientationLandscapeLeft) )
{
_pageBarConstraintBottom.priority = UILayoutPriorityRequired;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
每次在这里当机
}
}
作者: Blueshiva (龙野南云)   2017-07-13 13:32:00
你检查一下 _pageBarConstraintBottom.priority原本是不是设成1000,设成1000之后就不能改,初始要用999才行
楼主: duckscorpion (歆)   2017-07-13 14:41:00
感谢

Links booklink

Contact Us: admin [ a t ] ucptt.com