当前位置: 代码迷 >> Eclipse >> eclipse能不能设立源码的格式
  详细解决方案

eclipse能不能设立源码的格式

热度:86   发布时间:2016-04-23 00:30:31.0
eclipse能不能设置源码的格式?
默认的格式是这样
public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}


但是我觉得左大括号另换一行,与右大括号处在同一列上,这样比较好看,而且比较好检查大括号的配对。如下这样:
public class MainActivity extends Activity
{

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}

请问有没有什么办法设置一下?
------解决方案--------------------
  相关解决方案