4 MINDS

4MINDS Gestão de Conhecimento

NativeScript - transparent modal



Para habilitar transparência em um modal usando nativescript, no módulo page.ios.js, altere o método _showNativeModalView da seguinte maneira:

As seguintes linhas

     page.ios.js -> _showNativeModalView
_super.prototype._raiseShowingModallyEvent.call(this);
parent.ios.presentViewControllerAnimatedCompletion(this._ios, utils.ios.MajorVersion >= 7, null);
var transitionCoordinator = parent.ios.transitionCoordinator();
if (transitionCoordinator) {
    UIViewControllerTransitionCoordinator.prototype.animateAlongsideTransitionCompletion.call(transitionCoordinator, null, function () { return _this._raiseShownModallyEvent(); });
}
else {
    this._raiseShownModallyEvent();
}




Para

page.ios.js -> _showNativeModalView

_super.prototype._raiseShowingModallyEvent.call(this);

var that = this
this._ios.providesPresentationContextTransitionStyle = true;
this._ios.definesPresentationContext = true;
this._ios.modalPresentationStyle = UIModalPresentationOverFullScreen;
this._ios.view.backgroundColor = UIColor.clearColor(); // can be with 'alpha'

parent.ios.presentViewControllerAnimatedCompletion(this._ios, utils.ios.MajorVersion >= 8, function(){
    that._ios.modalPresentationStyle     = UIModalPresentationCurrentContext;
    that._raiseShownModallyEvent(parent, context, closeCallback)            
});