[問題] 翻轉後改變constraint的priority當機

看板MacDev作者 (歆)時間8年前 (2017/07/13 11:43), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
想藉由在程式更改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

07/13 13:32, , 1F
你檢查一下 _pageBarConstraintBottom.priority原本是
07/13 13:32, 1F

07/13 13:33, , 2F
不是設成1000,設成1000之後就不能改,初始要用999才行
07/13 13:33, 2F

07/13 14:41, , 3F
感謝
07/13 14:41, 3F
文章代碼(AID): #1PPknVJM (MacDev)
文章代碼(AID): #1PPknVJM (MacDev)