gpt4 book ai didi

android - 阻止 Android Studio 包装方法和构造函数

转载 作者:bug小助手 更新时间:2023-10-28 10:46:44 25 4
gpt4 key购买 nike

如何阻止 Android Studio 包装方法行和构造函数?

这就是 Android Studio 目前的做法:

一个类

public class Foo {

public Foo(Context context, AttributeSet attrs) { super(context, attrs); }
}

一种方法

public static void doSomething(Foo foo) { foo.doWork(); }

这就是我想要的:

一个类

public class Foo {

public Foo(Context context, AttributeSet attrs) {
super(context, attrs);
}
}

一种方法

public static void doSomething(Foo foo) { 
foo.doWork();
}

最佳答案

导航到

Settings >> Editor >> General >> Code Folding

你会发现 One-line methods 在那里被选中。取消选中它。还有其他设置,你可以根据需要进行更改。我也附上了截图。

enter image description here

最后重新启动您的 IDE。完成!

希望这有帮助。

关于android - 阻止 Android Studio 包装方法和构造函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25254172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com