一個(gè)recycleView里有editview和radioButton,在每次點(diǎn)擊radioButton的時(shí)候會(huì)滾回到editView,體驗(yàn)很不好
初步判斷是editView搶占了焦點(diǎn),一直在editView上,所以導(dǎo)致一直在editView上,希望的結(jié)果是每次點(diǎn)擊radioButton的時(shí)候,可以不要滾動(dòng),
所以我就在每次點(diǎn)擊radioButton的時(shí)候加上焦點(diǎn)
chooseBtn.setFocusable(true);
chooseBtn.setFocusableInTouchMode(true);
chooseBtn.requestFocus();
chooseBtn.findFocus();
然后就好了!
中間誤入了很長(zhǎng)一點(diǎn)時(shí)間想要去掉editView的焦點(diǎn),然后又要去掉radio的焦點(diǎn),然后走入死胡同了,其實(shí)只要每次焦點(diǎn)在當(dāng)前操作的控件上就好了!