1
我有一個UIView,我想通過50改變位置不起作用
把它移到了我寫了下面:
NSLog(@"before %@",NSStringFromCGRect(_flixSuggestionsView.frame));
_flixSuggestionsView.frame = CGRectMake(_flixSuggestionsView.frame.origin.x, _flixSuggestionsView.frame.origin.y-45, _flixSuggestionsView.frame.size.width, _flixSuggestionsView.frame.size.height);
NSLog(@"after %@",NSStringFromCGRect(_flixSuggestionsView.frame));
輸出是:
before {{0, 175}, {320, 324}}
after {{0, 130}, {320, 324}}
但UIView保持在同一位置。
我錯過了什麼?
檢查Autolayout(或任何自動調整選項)未激活。 –
它是活動的。但我不需要它嗎? – Dejell