Buscar..


implementar View.OnLayoutChangeListener en Nativescript


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();
          }
      }
    });

crear una vista de superficie http://stackoverflow.com/documentation/proposed/changes/79536

Añadir escucha:

    surfaceView.addOnLayoutChangeListener(playerLayoutChangeListener);

eliminar Oyente:

    surfaceView.removeOnLayoutChangeListener(playerLayoutChangeListener);


Modified text is an extract of the original Stack Overflow Documentation
Licenciado bajo CC BY-SA 3.0
No afiliado a Stack Overflow