2016-09-04 49 views

回答

1

實現setOnTouchListener您VideoView你可以找出哪些位置點擊:

videoView.setOnTouchListener(new View.OnTouchListener() { 
      float x; 
      float y; 

      @Override 
      public boolean onTouch(View view, MotionEvent motionEvent) { 
       switch (motionEvent.getAction()){ 
        case MotionEvent.ACTION_DOWN: 
         motionEvent.getY(); 
         motionEvent.getX(); 
       } 
       return false; 
      } 
     }); 

上面的代碼可以在Android-studio同樣的方法用在Unity[here]Xamarin 存在。

+0

使用這個想法有什麼不同? –

+0

這實際上取決於你想要實現什麼。在原生android應用程序使用android studio的情況下,如果您需要多平臺應用程序使用xamarin,並且您需要遊戲引擎使用Unity。 – Amir