如何让android studio中函数的参数在代码格式上保持单行?
在按下ctrl+alt+L时,android studio会格式化代码,但它也会将所有函数参数放在不同的行上,如何阻止这种情况发生。此函数如下所示如何让android studio中函数的参数在代码格式上保持单行?,android,android-studio,intellij-idea,Android,Android Studio,Intellij Idea,在按下ctrl+alt+L时,android studio会格式化代码,但它也会将所有函数参数放在不同的行上,如何阻止这种情况发生。此函数如下所示 private fun paintWithColor(list: MutableList<Button>, colorID: Int, index: Int) { list[index].setBackgroundColor( ContextCompat.getColor( this,
private fun paintWithColor(list: MutableList<Button>, colorID: Int, index: Int) {
list[index].setBackgroundColor(
ContextCompat.getColor(
this,
colorID
)
)
}
private fun paintWithColor(列表:可变列表,colorID:Int,索引:Int){
列表[索引].setBackgroundColor(
ContextCompat.getColor(
这
彩色
)
)
}
变成这样
private fun paintWithColor(
list: MutableList<Button>,
colorID: Int,
index: Int
) {
list[index].setBackgroundColor(
ContextCompat.getColor(
this,
colorID
)
)
}
private fun paintwith color(
列表:可变列表,
colorID:Int,
索引:Int
) {
列表[索引].setBackgroundColor(
ContextCompat.getColor(
这
彩色
)
)
}
如何停止此操作???请检查设置(macOS上的首选项)|编辑器|代码样式| Kotlin |包装和大括号|方法声明参数中的包装选项。设置为“不换行”