수색…


Nativescript에 View.OnLayoutChangeListener 구현하기


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

surfaceView 만들기 http://stackoverflow.com/documentation/proposed/changes/79536

리스너 추가 :

    surfaceView.addOnLayoutChangeListener(playerLayoutChangeListener);

청취자 제거 :

    surfaceView.removeOnLayoutChangeListener(playerLayoutChangeListener);


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow