Android : Multi line text EditText inside BottomSheetDialog

后端 未结 3 469
名媛妹妹
名媛妹妹 2021-01-02 10:33

I have a bottom sheet dialog and exists EditText in layout. EditText is multiline, max lines is 3. I put :

commentET.setMovementMethod(new ScrollingMovementM         


        
3条回答
  •  情歌与酒
    2021-01-02 10:40

    For those who are interested in Kotlin solution. Here it is

    editText.setOnTouchListener { v, event ->
        v.parent.requestDisallowInterceptTouchEvent(true)
        when (event.action and MotionEvent.ACTION_MASK) {
            MotionEvent.ACTION_UP -> 
                          v.parent.requestDisallowInterceptTouchEvent(false)
        }
        false
    }
    

提交回复
热议问题