как скрыть дескриптор выбора текста из веб-просмотра: Android - PullRequest
0 голосов
/ 07 мая 2019

У меня есть собственное веб-представление, в котором пользователь может выбрать текст, я хочу скрыть «РУЧКИ ВЫБОРА ТЕКСТА», когда пользователь нажимает на какую-то кнопку внизу, я хочу, чтобы текст был выделен, но хочу скрыть ручки, так какВы можете увидеть ниже: enter image description here

Ответы [ 2 ]

1 голос
/ 07 мая 2019
// call hideTextSelection() from your onCreate()
 function hideTextSelection(){    
 //SOLUTION 1->   vibration caused by the long click not works here
   webView.setHapticFeedbackEnabled(false);   

   //Solution 2: 
   /*webView.setOnLongClickListener(new OnLongClickListener() {
     @Override
     public boolean onLongClick(View v) {
       return true;
     }
   });
   webView.setLongClickable(false);*/
}


// whenever you wants to select the data ie. after onClicking the button 'from the bottom of your UI', make it to select as below
yourBottomButton.setOnClickListener(new OnClickListener() {
 @Override
 public boolean onClick(View v) {
  webView.setHapticFeedbackEnabled(true);
 }

});

0 голосов
/ 07 мая 2019

Попробуйте это

mWebView.setOnLongClickListener(new OnLongClickListener() {
@Override
    public boolean onLongClick(View v) {
        return true;
    }
});
mWebView.setLongClickable(false);
...