Windows: Ctrl + Alt + L
(Windows: Ctrl + Alt + L.)
Linux: Ctrl + Shift + Alt + L
(Linux: Ctrl + Shift + Alt + L.)
macOS: Option + Command + L
(macOS: Option + Command + L.)
Reference: Key Commands and here are all of the commands for Windows/ Linux users and for Mac users .
(参考: 键盘命令 ,以下是Windows / Linux用户和Mac用户的所有命令。)
As Rohit faced a problem in Ubuntu with the format code shortcut, this is due to the Ctrl + Alt + L key being used to lock the screen in Ubuntu.
(由于Rohit在Ubuntu中遇到了格式代码快捷方式的问题,这是由于Ctrl + Alt + L键用于锁定Ubuntu中的屏幕。)
I found that Ubuntu handles this keyboard shortcut first.
(我发现Ubuntu首先处理这个键盘快捷键。)
So you should bind the Ctrl + Alt + L keyboard shortcut to something else so that it doesn't conflict with Ubuntu. (因此,您应该将Ctrl + Alt + L键盘快捷键绑定到其他内容,以便它不会与Ubuntu冲突。)
Steps (脚步)
Go to System Tools → System Settings → Keyboard → Shortcuts tab → System → Lock Screen .
(进入系统工具 → 系统设置 → 键盘 → 快捷方式选项卡→ 系统 → 锁定屏幕 。)
Select the row New Accelerator... , then press any special key with the Alpha key (eg Shift + L ).
(选择New Accelerator ...行,然后按任意特殊键和Alpha键(例如Shift + L )。)
You should've successfully changed the keyboard shortcut. (您应该已成功更改键盘快捷键。)
Check if the keyboard shortcut now works in Android Studio.
(检查键盘快捷键现在是否可以在Android Studio中使用。)
Alternative method (替代方法)
Ctrl + Alt + Shift + L (to show a dialog)
(Ctrl + Alt + Shift + L (显示对话框))
You can also use Eclipse shortcuts.
(您还可以使用Eclipse快捷方式。)
Using MenuBar (使用MenuBar)
In Android studio 3.5, there is problem with rearranging the xml code, it also rearrange the views as well, so need to use these settings first.
(在Android studio 3.5中,重新排列xml代码存在问题,它也会重新排列视图,因此需要先使用这些设置。)
Settings -> Editor -> Code Style -> XML-> Set From -> Predefined Style > Android.
(设置 - >编辑器 - >代码样式 - > XML->设置自 - >预定义样式> Android。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…