Android Studio快捷键switch case 轻松转换为if else

Android Studio快捷键switch case 轻松转换为if else

今天碰到的问题,没有找到资料,后面找到了方法,这个记下来,转载请注明出处:http://www.cnblogs.com/LT5505/p/5462820.html

原始代码如下:

随后选中“switch”,ALt+Enter同时选中,弹出对话框,选择“Replace 'switch' with 'if'”,

选中之后,点击,即可将“switch”转换为了'if'样式,如果需要转回“switch”,同样的快捷键方式,轻松转换。

注:windows中的快捷键为Alt+Enter,而Mac中的快捷键则为Option+Return

原文地址:https://www.cnblogs.com/LT5505/p/5462820.html