Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ツールバーを追加し、そのツールバーにボタンを追加しています。そのボタンは、そのボタンに設定したフレームに関係なく、自動的に左に配置されます。そのボタンをツールバーの中央にしたい。それを作る方法は?
ボタンの左側(および右側)のタブバーに柔軟なスペースを追加します。
UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
ボタンと一緒に、ボタンの右側と左側に柔軟なスペースアイテムを追加します