简体   繁体   中英

Android emulator not displaying a TextView properly (works fine on device)

I have a minor issue with displaying TextViews in my app while running on emulator, although everything works perfectly fine on my cell phone. I know that most of you wouldn't care about that, but I have to obtain top quality screen shots of my app (it's my project for graduation and I need those screen shots to include in the project documentation).

Those TextViews which are populated with some value in the XML layout file display properly. However, those which are populated dynamically after the user logs in (a String value from a web service) are only displayed partially, like only the top half of the line will appear, you can see it on this screen shot:

链接到带有截图的imageshack文件

As I mentioned, everything displays perfectly fine on my device (Samsung i5510). Those TextViews are a part of a TableLayout and each row (static label in the left column and a dynamic value in the right one). The XML layout is as follows:

                <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>

How do I fix this?

可能是因为您在textviews上填充了内容。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM