Fabio Poloni Fabio Poloni - 1 year ago 136
Objective-C Question

Get the width of a UIBarButtonItem

I'm trying to get the width of a


This doesn't work:


And this won't work, either:


Answer Source

What about this:

UIBarButtonItem *item = /*...*/;
UIView *view = [item valueForKey:@"view"];
CGFloat width = view? [view frame].size.width : (CGFloat)0.0;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download