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

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

原始代码如下:

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

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

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

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

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

 

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-10-30
  • 2021-09-29
  • 2022-12-23
  • 2021-07-05
  • 2021-05-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-01-16
  • 2022-12-23
相关资源
相似解决方案