Settings→Editor→General→Auto Import 然后勾选Add unambiguous imports on the fly以及Optimize imports on the fly 结果如下: