#pragma 标记等效于 Android Studio [英] #pragma mark equivalent in Android Studio
本文介绍了#pragma 标记等效于 Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Xcode 中的 跳转栏和 #pragma mark 在 Objective-C 中非常有帮助,我正在 Android Studio 中寻找类似的东西(原生或插件).
解决方案
在 Android Studio 中,您可以使用以下步骤添加区域
<块引用>- 打开您正在使用的 IDE
- 选择要分组的代码
- 按 Ctrl + Alt + T(Mac 为 Cmd + Opt + T)并选择region .. end region comments"
- 现在代码用//region"///endregion"行包围,可以看到该区域可以折叠
- 您现在可以编辑您的群组的描述
- 您无需展开群组即可轻松查看群组内的代码,只需将鼠标指针悬停在群组说明上
见这个
The jump bar in Xcode and #pragma mark in Objective-C are very helpful and I'm looking for anything similar in Android Studio (either native or by plug-in).
解决方案
In Android Studio you can add regions using the steps below
- Open the IDE you are using
- Select the code you want to group
- Press Ctrl + Alt + T (Cmd + Opt + T for mac) and select the "region .. end region comments"
- Now the code is surrounded with "//region" / "//endregion" lines, you can see that the region can be fold-able
- You can now edit the description of your group
- You can easily see the code within your group without having to expand the group, just hover the group description with the mouse pointer
See this
这篇关于#pragma 标记等效于 Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文