【发布时间】:2012-08-23 22:48:30
【问题描述】:
当我尝试在 Eclipse Helios 中格式化代码时,通过按 ctrl+shift+f 来格式化代码,但是结果非常难看。例如,一行中有两个或三个语句。压痕也很差。
例如:格式化代码后的样子:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@drawable/scannerbg">
<include android:id="@+id/headerLayout"
android:layout_alignParentTop="true" layout="@layout/headerlayout" />
<ListView android:layout_below="@id/headerLayout"
android:layout_height="fill_parent" android:layout_marginTop="5dp"
android:listSelector="@android:color/transparent" android:id="@+id/listView"
android:layout_width="fill_parent">
</ListView>
</RelativeLayout>
正如您在ListView 中看到的,单行中有两到三个语句。
谁能提供解决方案?
【问题讨论】:
-
我也解决了这个问题。所以我用靛蓝。
-
不,但我有另一个只有 Eclipse Helios 的 m/c,但它可以在那个 m/c 上正常工作。
-
我会从这个问题中删除
android标签。与它无关.. -
我保留了那个标签,只是为了引起多个用户的注意。
标签: keyboard-shortcuts code-formatting eclipse-3.6