作者duckscorpion (歆)
看板MacDev
標題[問題] 翻轉後改變constraint的priority當機
時間Thu Jul 13 11:43:24 2017
想藉由在程式更改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;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
每次在這裡當機
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.116.79.81
※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1499917407.A.4D6.html
推 Blueshiva: 你檢查一下 _pageBarConstraintBottom.priority原本是 07/13 13:32
→ Blueshiva: 不是設成1000,設成1000之後就不能改,初始要用999才行 07/13 13:33
→ duckscorpion: 感謝 07/13 14:41