![](/img/trans.png)
[英]Android application works fine in emulator but not in real device?
[英]Android emulator not displaying a TextView properly (works fine on device)
在模拟器上运行时,我在应用程序中显示TextViews时遇到了一个小问题,尽管在手机上一切正常。 我知道你们中的大多数人都不会在意这一点,但是我必须获得我的应用程序的高质量屏幕截图(这是我的毕业项目,我需要这些屏幕截图包含在项目文档中)。
在XML布局文件中填充了某些值的那些TextView可以正确显示。 但是,在用户登录后动态填充的那些内容(来自Web服务的String值)仅会部分显示,就像仅显示该行的上半部分一样,您可以在此屏幕快照中看到它:
正如我提到的,在我的设备(Samsung i5510)上一切正常显示。 这些TextView是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>
我该如何解决?
可能是因为您在textviews上填充了内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.