Recherche…


implémenter View.OnLayoutChangeListener dans Natifscript


let playerLayoutChangeListener = new android.view.View.OnLayoutChangeListener( {
      onLayoutChange : function ( v:View, left:number, top:number, right:number, bottom:number, oldLeft:number, oldTop:number, oldRight:number, oldBottom:number):any {
          if (left != oldLeft || top != oldTop || right != oldRight || bottom != oldBottom) {
              console.log("OnLayoutChangeListener");
              __this.changeSurfaceLayout();
          }
      }
    });

créer une surfaceView http://stackoverflow.com/documentation/proposed/changes/79536

Ajouter un auditeur:

    surfaceView.addOnLayoutChangeListener(playerLayoutChangeListener);

supprimer l'auditeur:

    surfaceView.removeOnLayoutChangeListener(playerLayoutChangeListener);


Modified text is an extract of the original Stack Overflow Documentation
Sous licence CC BY-SA 3.0
Non affilié à Stack Overflow