LoginSignup
8
8

More than 5 years have passed since last update.

UIToolBarのボタンを等間隔に置く方法

Posted at

各UIBarButtonItemを作ったら、最後にスペース用のUIBarButton作成のために下記を記述。

UIBarButtonItem *gap = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];

そして、配置の際に各UIBarButtonItemの前後にこのスペース用のUIBarButtonItemを置けばOK!

NSArray *items = @[gap, _backButton, gap, _forwardButton, gap, _reloadButton, gap, _shareButton, gap];
    self.toolbarItems = items;

参考URL:http://torus.tumblr.com/post/4966442542/uitoolbar

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8