Kotlin: How can I let Android Studio implement interface's function at bottom of class

…衆ロ難τιáo~ 提交于 2019-12-05 20:24:27

问题


When implementing an interface in a Kotlin class:

When I press Alt+Enter on ClassName I can have the IDE add an interface's functions via 'implement members'.

It's kind of annoying that in Kotlin these functions are added at the top of the class. I would like them to be added at the end of the class (just like in Java).

How can I do that?


回答1:


Right now there is no possibility to control the order of the methods. Please watch the corresponding issue to get notified when this is implemented.




回答2:


On Android Studio 3.2: You can specify the desired location using the pointer, and use CTRL+I keymap. Then you need to choose the necessary methods, and Studio place them into your point position.



来源:https://stackoverflow.com/questions/45350594/kotlin-how-can-i-let-android-studio-implement-interfaces-function-at-bottom-of

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!