#pragma 标记等效于 Android Studio [英] #pragma mark equivalent in Android Studio

查看:27
本文介绍了#pragma 标记等效于 Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 中的 跳转栏#pragma mark 在 Objective-C 中非常有帮助,我正在 Android Studio 中寻找类似的东西(原生或插件).

解决方案

在 Android Studio 中,您可以使用以下步骤添加区域

<块引用>

  1. 打开您正在使用的 IDE
  2. 选择要分组的代码
  3. 按 Ctrl + Alt + T(Mac 为 Cmd + Opt + T)并选择region .. end region comments"
  4. 现在代码用//region"///endregion"行包围,可以看到该区域可以折叠
  5. 您现在可以编辑您的群组的描述
  6. 您无需展开群组即可轻松查看群组内的代码,只需将鼠标指针悬停在群组说明上

这个

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

  1. Open the IDE you are using
  2. Select the code you want to group
  3. Press Ctrl + Alt + T (Cmd + Opt + T for mac) and select the "region .. end region comments"
  4. Now the code is surrounded with "//region" / "//endregion" lines, you can see that the region can be fold-able
  5. You can now edit the description of your group
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆