Simon
Simon

Reputation: 19938

Android Studio: generate getters and setters below the field

These are my two variables in Android Studio:

enter image description here

I generate the getters and setters by setting my cursor on the field called "distance" and then CMD - N:

enter image description here

This is the result:

enter image description here

I don't understand why the field is always at the bottom and the getters and setters are at the top. I always have to manually switch them around so it looks like this:

enter image description here

This seems to happen in IntelliJ as well.

Is there no way to make getters and setters sit below the field instead of above it? It would definitely save me some time as I don't have to manually move the field.

Upvotes: 1

Views: 1798

Answers (1)

Bas Leijdekkers
Bas Leijdekkers

Reputation: 26482

The getter and setter are generated in the position of the text cursor. Try to position the text cursor where you want the getter and setter to end up and then generate them.

Upvotes: 3

Related Questions