3
我想隱藏工具欄按鈕。首先在我的viewDidLoad中,我隱藏了其中一些,並且完美地工作。我不想隱藏btnCreateReport。我只是用:刪除UIToolBar按鈕不起作用
NSMutableArray *items = [[myToolBar.items mutableCopy] autorelease];
[items removeObject: btnEmailReport];
[items removeObject: btnSaveToIpad];
[items removeObject: btnPrintReport];
[items removeObject: btnNewInspection];
myToolBar.items = items;
後來,當我嘗試使用了隱藏其中的2:
NSMutableArray *items = [[myToolBar.items mutableCopy] autorelease];
[items addObject: btnEmailReport];
[items removeObject: btnSaveToIpad];
[items addObject: btnPrintReport];
[items addObject: btnNewInspection];
[items removeObject:btnCreateReport];
myToolBar.items = items;
的btnCreateReport不會消失。什麼會導致這樣的事情? 謝謝!