作者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://webptt.com/cn.aspx?n=bbs/MacDev/M.1499917407.A.4D6.html
1F:推 Blueshiva: 你检查一下 _pageBarConstraintBottom.priority原本是 07/13 13:32
2F:→ Blueshiva: 不是设成1000,设成1000之後就不能改,初始要用999才行 07/13 13:33
3F:→ duckscorpion: 感谢 07/13 14:41