私はそれぞれ14文字の異なるボタンがあります。また、すべてのボタンが自動レイアウトで接続されています。だから、狂ったたくさんの制約があります。説明のための最初の画像を参照してください:私のプログラムでは、自動レイアウトとアニメーション
しかし、私は、全体のオートレイアウトの設定をめちゃくちゃにせずにUIAnimation
を前後に一つ一つのボタンを移動できるようにしたいです。私がやりたいことは、説明のための第2の画像を参照してください。
self.letterA.translatesAutoresizingMaskIntoConstraints = YES;
[UIView animateWithDuration:0.2 animations:^{
[letterA setFrame:CGRectMake(x, y, width, height)];
}];
今すぐプログラムが完璧に動作します:
が今のコードは、私は現在、これらのアニメーションを取得するために使用!全く問題はありません!
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
そして、この警告/エラー/問題がUIButton
が移動される毎回、およびオンと何回かに行く:しかし、唯一の「問題」は、このコードは、コンソールでこのメッセージを生成しています。今私は何をすべきですか?
Unable to simultaneously satisfy constraints
を無視できますか?それとも、それは道路のトラブルを引き起こすでしょうか?- もしそうでなければ、それを修正するには?そして狂った量の制約がかかわっているので、どのように単一の制約を編集することなく修正することができますか?
- 私は非常にあなたが自動レイアウトを使用している場合はfalseにtranslateAutoResizingMaskを設定する必要があり
setFrame: