Changing the Style of Braces in Android Studio

前端 未结 2 1477
春和景丽
春和景丽 2021-01-30 15:57

I recently started to use Android Studio. It uses this style of braces by default:

public void scanFile(String filePath) {

}

The code I need

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 16:21

    You need to change the code style in Project Settings

    File -> Settings -> (Project Settings) -> Code Style -> Java -> Wrapping and Brances
    

    Change the Braces Placement for Class and Method declaration to Next Line

    (Or, on a Mac, do the same thing in Preferences)

    enter image description here

提交回复
热议问题