简体   繁体   中英

access the toolbar created in interface builder

在此处输入图片说明

Is it possible to access and manipulate the toolbar (See bottom of picture) defined in interface builder in a corresponding viewcontroller?

Those are Simulated Metrics as state in title, they are only displayed in the interface builder. It is to let you see what your view looks like if it is contained in for example an UInavigationController .

u can set IBOutlet of toolbar then u can access and manipulate

@property (weak, nonatomic) IBOutlet UIToolbar     *toolBar;

how u can connect ?

I did a combination of the things in this thread and I finally had success.

In Interface builder (not xcode)

File->Reload All Class Files
File->Read Class Files (select MyClass.h)
Reconnect File's Owner by
a. Setting the Class to "MyClass"
b. Reconnecting the View to the File's Owner's View

Everything is back to normal now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM