@@ -139,14 +139,11 @@ export class ActionBar extends common.ActionBar {
139139 var barButtonItem : UIBarButtonItem ;
140140
141141 if ( item . actionView && item . actionView . ios ) {
142- let buttonView : UIButton = UIButton . buttonWithType ( UIButtonType . UIButtonTypeSystem ) ;
143- // Disable the interaction of the custom view so that the tap event of the button is triggered
144- ( < UIView > item . actionView . ios ) . userInteractionEnabled = false ;
145-
146- buttonView . addTargetActionForControlEvents ( tapHandler , "tap" , UIControlEvents . UIControlEventTouchUpInside ) ;
147- buttonView . frame = CGRectMake ( 0 , 0 , item . actionView . getMeasuredWidth ( ) , item . actionView . getMeasuredHeight ( ) ) ;
148- buttonView . addSubview ( item . actionView . ios ) ;
149- barButtonItem = UIBarButtonItem . alloc ( ) . initWithCustomView ( buttonView ) ;
142+ if ( item . hasListeners ( ActionItem . tapEvent ) ) {
143+ var recognizer = UITapGestureRecognizer . alloc ( ) . initWithTargetAction ( tapHandler , "tap" ) ;
144+ item . actionView . ios . addGestureRecognizer ( recognizer ) ;
145+ }
146+ barButtonItem = UIBarButtonItem . alloc ( ) . initWithCustomView ( item . actionView . ios ) ;
150147 }
151148 else if ( types . isNumber ( item . ios . systemIcon ) ) {
152149 barButtonItem = UIBarButtonItem . alloc ( ) . initWithBarButtonSystemItemTargetAction ( item . ios . systemIcon , tapHandler , "tap" ) ;
@@ -244,16 +241,12 @@ export class ActionBar extends common.ActionBar {
244241 if ( actionItem . actionView && actionItem . actionView . ios ) {
245242 let measuredWidth = actionItem . actionView . getMeasuredWidth ( ) ;
246243 let measuredHeight = actionItem . actionView . getMeasuredHeight ( ) ;
247- let buttonView = ( < UIView > actionItem . actionView . ios ) . superview ;
248-
249244 view . View . layoutChild ( this , actionItem . actionView , 0 , 0 , measuredWidth , measuredHeight ) ;
250- if ( buttonView ) {
251- buttonView . frame = CGRectMake ( 0 , 0 , measuredWidth , measuredHeight ) ;
252- }
253245 }
254246 } ) ;
255247
256248 super . onLayout ( left , top , right , bottom ) ;
249+ this . ios . setNeedsLayout ( ) ;
257250 }
258251
259252 public layoutNativeView ( left : number , top : number , right : number , bottom : number ) {
0 commit comments