phonegap/phonegap-plugins — Issue #257: NativeControls Toolbar won't display custom icon (suggested fix)
Author: jph108
Created: 2011-11-27 03:32:02+00:00
State: open

The NativeControls Toolbar won't display a custom icon, and this seems to be due to a bug in NativeControls.m.

Line 608 begins:

if (systemItem) {
// then display a UIBarButton.... icon
}
else {
// use a custom image
}

However, systemItem has been set to -1 on line 527, and the code following that up to line 608 could fail to supply a new value. In that case, the "if (systemItem)" check succeeds because systemItem is -1, instead of failing as it should in that case. The result is that no icon is displayed.

Changing line 608 to read "if (systemItem != -1)" fixes this problem.