简体   繁体   English

如何防止 Android Studio 在项目导航中自动折叠我的包?

[英]How do I prevent Android Studio from automatically collapsing my packages in project navigation?

I have run into this annoyance over and over again and have been unable to find a solution or an answer here for it:我一遍又一遍地遇到这种烦恼,并且无法在这里找到解决方案或答案:

When I create a package in my application and then add a package within it, if I do not have a file in the directory already it will auto collapse my package in the left-side navigation of Android Studio.当我在我的应用程序中创建一个 package,然后在其中添加一个 package 时,如果目录中还没有文件,它会自动折叠 Android Studio 左侧导航栏中的 package。 This prevents me from adding other sub-packages to the parent package, without manually resolving the issue within the file system.这可以防止我将其他子包添加到父 package,而无需手动解决文件系统中的问题。

For Example:例如:

折叠导航示例

What I want is:我想要的是:

-presentation   
  -screens
     -devicescreen
         -adapters
         -presenters
         -views

In the 1:Project view, you have Hide Empty Middle Packages turned ON. 1:Project视图中,您已将“ Hide Empty Middle Packages打开”。 You need to turn it off. 你需要把它关掉。 Once turned off it will be shown as Compact Empty Middle Package . 关闭后,它将显示为Compact Empty Middle Package Please look at the screenshot attached. 请查看附带的截图。

在此输入图像描述

With Android Studio Android Studio Electric Eel | With Android Studio Android Studio 电鳗 | 2022.1.1 you need to switch to Project View and then click on Settings icon from the right top side and then disable Compact Middle Packages under the Tree Appearance and then you create your sub package folder it will not merge/collapse and work as a sub-package as we need. 2022.1.1您需要切换到项目视图,然后单击右上角的设置图标,然后在树外观下禁用紧凑型中间包,然后创建子 package 文件夹,它不会合并/折叠并作为子文件夹工作- 根据需要打包。

禁用紧凑型中间包

This will prevent android studio to automatically collapse the package and sub-package.这将防止 android 工作室自动折叠 package 和子包。 Please upvote this thread if it finds helpful to you.如果觉得对您有帮助,请点赞此帖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 GitHub 库导入我的 android 工作室项目? - How do I import a GitHub library into my android studio project? Android 组件导航如何防止每次点击刷新地图页面 - Android Component Navigation how do i prevent the map page from refreshing on every click 如何将我的 android 工作室项目设置为我的手机背景? - How do I set my android studio project as my phones background? 如何将我的Android Eclipse项目迁移到使用Gradle和Android Studio? - How do I migrate my Android Eclipse project to using Gradle and Android Studio? 如何防止JXTreeTable根节点崩溃? - How can I prevent a JXTreeTable root node from collapsing? 如何防止用户在android studio中从键盘输入特定字符? - How do I prevent user from typing specific characters from the keyboard in android studio? 如何防止显示状态栏和导航? - How do I prevent the Status Bar and Navigation from ever showing? Android Studio 如何在使用导航视图时将数据从片段传递到片段? - Android Studio How do I pass data from fragment to fragment when a navigation view is being used? Android Studio:如何创建滑动标签导航? - Android Studio: How do I create sliding tab navigation? 如何构建我的 Android Studio 项目以避免在运行集成了单元测试的应用程序时出现编译问题 - How do I structure my Android Studio project to avoid compilation issues with running the app with unit tests integrated
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM