通过配置:<item name="android:windowCloseOnTouchOutside">true</item> 通过代码:setFinishOnTouchOutside(true); 来自为知笔记(Wiz)