Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何让android studio中函数的参数在代码格式上保持单行?_Android_Android Studio_Intellij Idea - Fatal编程技术网

如何让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,

在按下ctrl+alt+L时,android studio会格式化代码,但它也会将所有函数参数放在不同的行上,如何阻止这种情况发生。此函数如下所示

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 |包装和大括号|方法声明参数中的包装选项。设置为“不换行”