[英]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.