问题:
I have a view which has dynamic height and I am trying to change this view height priority in run time.我有一个具有动态高度的视图,我正在尝试在运行时更改此视图高度优先级。
Here is my part of code;这是我的代码部分;
if (index == 0) {
surveyViewHeightConstraint.constant = 0;
surveyViewHeightConstraint.priority = 1000;
} else if (index == 1) {
surveyViewHeightConstraint.constant = 163;
surveyViewHeightConstraint.priority = 500;
}
I am changing index with a button action.我正在通过按钮操作更改索引。 When I run this code, I am getting this error:当我运行此代码时,出现此错误:
*** Assertion failure in -[NSLayoutConstraint setPriority:], /SourceCache/Foundation/Foundation-1141.1/Layout.subproj/NSLayoutConstraint.m:174
What is my mistake in here?我在这里有什么错误?