最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Android Studio always opens up Compose Preview pane no matter what kind of Kotlin file gets created - Stack Overflow

programmeradmin2浏览0评论

Recently, I stumbled upon what seems to be a strange glitch in Android Studio. No matter what kind of Kotlin file I create (object, interface, class—anything), the IDE always opens it as if it contains a Jetpack Compose function with previews. Most of the time, I have to manually switch back to the "Code" pane, since I create Fragments, ViewModels, and UseCases far more often than Composables. This ends up wasting time with each new file.

Is there a way to fix this through Studio’s configuration settings? I believe there should be some setting which I changed without even noticing it, because I couldn't find anything about such behavior on web, so most likely this is not an issue experienced by many.

Recently, I stumbled upon what seems to be a strange glitch in Android Studio. No matter what kind of Kotlin file I create (object, interface, class—anything), the IDE always opens it as if it contains a Jetpack Compose function with previews. Most of the time, I have to manually switch back to the "Code" pane, since I create Fragments, ViewModels, and UseCases far more often than Composables. This ends up wasting time with each new file.

Is there a way to fix this through Studio’s configuration settings? I believe there should be some setting which I changed without even noticing it, because I couldn't find anything about such behavior on web, so most likely this is not an issue experienced by many.

Share Improve this question asked Mar 28 at 11:28 agaaga 29.5k13 gold badges90 silver badges127 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 4

You can toggle this in Settings | Editor | UI Tools:

Make sure the setting for Kotlin is set to Code. You may want to tick the checkbox Show split mode if file contains preview annotation to automatically enable the split mode instead when the file actually contains previews.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论