admin管理员组

文章数量:1355721

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.

本文标签: