“Android”中的WYSIWYG视图编辑器?

时间:2010-02-02 16:38:55

标签: xml android eclipse editor wysiwyg

  

重复Is there any form designer available for Google Android?

我想移动一个CheckBox,因此它显示在main.xml内的Absolute Layout下的左上角不同的位置,用于“Android”。我正在使用Eclipse编辑我的视图。我该怎么做?

在iPhone上,他们有一个名为Interface builder的工具,可以让你以WYIWYG方式移动东西。 Eclipse有类似的功能吗?

2 个答案:

答案 0 :(得分:1)

我建议使用RelativeLayout。您可以将复选框相对于其他视图或父视图定位,例如,如果要将其放置在右侧和TextView下方,则可以使用类似

的内容。
<RelativeLayout
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  >
  <TextView
    android:id="@+id/textview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Text"
    />
  <CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/textview"
    />
</RelativeLayout>

另请参阅droiddraw.org,但我建议您自己编写代码,因为如果您需要编辑/重复使用,可以加快处理速度。

有关RelativeLayout的更多信息,请查看http://d.android.com/reference/android/widget/RelativeLayout.html

答案 1 :(得分:1)

Eclipse中的Android插件有一个WYSIWYG编辑器,只在布局xml文件上打开。但是我猜你已经知道这一点,而是想知道如何在可视化编辑器中进行绝对定位。简短的回答是“不”,因为Android屏幕有许多不同的形状和大小,不像(现在)iPhone。

相关问题