Dialog with custom view, setCanceledOnTouchOutside doesn't work

后端 未结 2 2095
遇见更好的自我
遇见更好的自我 2021-01-07 04:15

am using a Dialog with a custom view. That view\'s layout is 300dp x 300dp is size and centered on the screen. Now i want it to be dismissed when the user touches outside th

2条回答
  •  感动是毒
    2021-01-07 04:40

    i did solve it now by wrapping my custom dialog view layout with an additional LinearLayout and adding an onTouchListener to this wrapping LinearLayout. In that onTouchListener i checked if the click was inside or outside the dialog.

提交回复
热议问题