LoginSignup
1
1

More than 5 years have passed since last update.

UIBarButtonItemで中にUIBarButtonがなくてなくしたい時

Posted at

UIBarButtonが中にあれば、

UIBARBUTTONNAME.hidden = YES;

でボタンを隠せるが、無いときはできないので以下のようにwidthを0.1にすれば隠れる。

UIBARBUTTONITEM.width = 0.1;

また表示したいときは0.0(auto width)にすればいい

UIBARBUTTONITEM.width = 0.0;

ただこれだとボタンが非表示の時でもクリックできちゃうのが問題点、、、

1
1
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
1
1