[TIMOB-2002] Systems buttons cannot be used in a view set to right/left nav button
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T03:07:51.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | iOS |
Labels | 1.4.2, 4.1, buttons, d1, defect, ios, ipad, nav, rplist |
Reporter | ctredway |
Assignee | Blain Hamon |
Created | 2011-04-15T03:07:49.000+0000 |
Updated | 2017-03-02T21:03:49.000+0000 |
Description
Using iOS 4.1 and 1.4.2.d4ce7ff when using a system button style does not work if the buttons are put in a view and that view is set as the right/left nav button.
See attached code
Attachments
File | Date | Size |
---|---|---|
blank.js | 2011-04-15T03:07:50.000+0000 | 473 |
System Buttons are only available in toolbars and nav bar left/right buttons (Not even title view) due to how the iOS does system buttons. Essentially, system buttons with the icons are not actual views, and as such, can not exist in any view beyond those locations. Long explanation below.
Natively, the class that represents an entry into a toolbar or nav bar corners is called UIBarButtonItem. Its inheritance tree is UIBarButtonItem->UIBarItem->NSObject, not UIView. When we put a view into a toolbar, we're actually adding UIBarButtonItem which was initialized with initWithCustomView:, passing in the UIView the proxy represents. When we put a system button into a toolbar, we're adding a UIBarButtonItem which was initialized with initWithBarButtonSystemItem:target:action: , passing in the systemType integer, with no view representation.
This, incidentally, is also why system buttons are so limited in properties; The properties UIBarButtonItem provides for system button style buttons are enabled, image, title, width, and style (only 3 options). No height, no color, no transparency, tint, no background image.
Closed as invalid.