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

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

问题描述

Xcode具有一个名为 pragma mark 的功能,它非常实用,我正在寻找对于与Android Studio类似的任何东西,它可以是本机或插件.

Xcode have a feature called pragma mark It's very util and I'm looking for anything similar into Android Studio it can be native or a plugin.

推荐答案

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

In Android Studio you can add regions using the steps below

  1. 打开您正在使用的IDE
  2. 选择要分组的代码
  3. 按Ctrl + Alt + T(对于Mac,则为Cmd + Opt + T),然后选择区域..结束区域注释"
  4. 现在代码被"//region"/"//endregion"行包围,您可以看到该区域是可折叠的
  5. 您现在可以编辑组的描述
  6. 您可以轻松地在组中查看代码,而无需扩展组,只需将鼠标指针悬停在组描述上即可.
  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

请参见

这篇关于Android Studio中的#pragma标记等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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