【发布时间】:2012-05-31 08:44:21
【问题描述】:
在我的应用程序中,我经常依赖自定义构建视图,例如以下示例。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="@color/light_grey"
android:layout_height="match_parent"
android:layout_width="fill_parent" >
<TextView
style="@style/CardTitle"
android:id="@+id/card_title"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
<com.whiterabbit.cards.ui.AspectRatioImageView
android:id="@+id/card_picture"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_marginLeft="30dip"
android:layout_marginRight="30dip"
android:src="@drawable/boss"
/>
<ListView
android:id="@+id/card_properties"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
问题是,我不知道它是否会正确显示,直到我在真实设备或模拟器上运行它。此外,如果我发现有问题,我将不得不对其进行更改并再次部署应用程序以查看更改是否按预期工作。
这可能是一个漫长而无聊的过程,尤其是当应用程序需要一些交互才能到达您要检查的活动时。
使用可视化编辑器不起作用,因为它无法加载自定义视图。
是否有另一种方法可以在不运行整个应用程序的情况下检查视图的显示方式?
【问题讨论】:
-
感谢@Blundell 修改我的问题
标签: android eclipse android-layout adt visual-editor