[問題] 翻轉後改變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