加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xml – 它们是Android Studio的“区域式”折叠功能

发布时间:2020-12-16 07:46:42 所属栏目:百科 来源:网络整理
导读:我正在开发 Android Studio和其他IDE,Android Studio有一个功能,可以在java代码中创建可以折叠的“区域”. (见下文) 有了这种代码 //region INITIALIZATIONprivate int myVaribale;private String otherVariblae;//endregion 我们可以折叠/展开代码(参见下面
我正在开发 Android Studio和其他IDE,Android Studio有一个功能,可以在java代码中创建可以折叠的“区域”. (见下文)

有了这种代码

//region INITIALIZATION
private int myVaribale;
private String otherVariblae;
//endregion

我们可以折叠/展开代码(参见下面的屏幕截图).

它们与XML编辑器(特别是Android Studio中的编辑器)类似吗?

我们可以添加的东西,例如:

<!-- region MY LAYOUTS -->
<RelativeLayout>

   //Some layouts

</RelativeLayout>
<!-- endregion -->
你现在可以这样做:
<!--region Title-->
<View
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
<!--endregion-->

(我正在使用Android Studio 3.0并且不确定它何时受支持)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读