虽然在我的手机上一切正常,但我在模拟器上运行时在我的应用程序中显示TextView时存在一个小问题。我知道你们大多数人不会在意这一点,但我必须获得我的应用程序的高质量屏幕截图(这是我的毕业项目,我需要这些截屏以包含在项目文档中)。Android模拟器没有正确显示TextView(在设备上正常工作)
那些在XML布局文件中填充了一些值的TextViews正常显示。但是,那些在用户登录后动态填充(来自Web服务的字符串值)仅部分显示,例如只显示上半部分,您可以在此屏幕截图中看到它:
正如我所提到的,我的设备(三星i5510)上的一切都非常好。 这些TextViews是TableLayout的一部分,每行(左列中的静态标签和右列中的动态值)。 XML布局如下:
<TableRow android:id="@+id/brandTableRow" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingBottom="2sp" android:paddingTop="2sp">
<TextView android:id="@+id/brandLabel" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Model pojazdu:"
android:layout_column="1">
</TextView>
<TextView android:id="@+id/brandTextView"
android:layout_width="wrap_content" android:layout_height="12px"
android:text="" android:gravity="right">
</TextView>
</TableRow>
<TableRow android:id="@+id/widget67" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingBottom="2sp" android:paddingTop="2sp">
<TextView android:id="@+id/widget40" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Ping:"
android:layout_column="1">
</TextView>
<TextView android:id="@+id/pingTextView"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="n/a" android:gravity="right">
</TextView>
</TableRow>
我该如何解决这个问题?
只需检查AVD与您的设备匹配的屏幕分辨率/密度?如果不尝试匹配这两个,然后看看它的行为。 – havexz