Reputation: 11515
I am trying to display a simple table with a series of buttons, and labels to the right of them (black text).
At first, everything look correct in the SDK Graphical Layout. Now, (without making any changes) everything looks correct in the SDK except for the fact that the text is not black, as such:
When I run it in the emulator, everything seems kind-of centered, and the text is the correct color, but only the very left-side of the text is shown.
What's going on here?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/map_description_background">
<TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tableLayout1" android:layout_gravity="fill_horizontal">
<TableRow android:id="@+id/tableRow1" android:layout_height="wrap_content" android:layout_marginTop="75px" android:layout_width="wrap_content">
<ToggleButton android:textOff="Nautical" android:textOn="Statued" android:id="@+id/unitsButton" android:layout_width="wrap_content" android:layout_height="wrap_content"></ToggleButton>
<TextView android:textAppearance="?android:attr/textAppearanceLarge" android:text="Units" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/textView1" android:textColor="@color/maincolors"></TextView>
</TableRow>
<TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ToggleButton android:textOff="GPS" android:textOn="Magnetic" android:id="@+id/toggleButton2" android:layout_width="wrap_content" android:layout_height="wrap_content"></ToggleButton>
<TextView android:textAppearance="?android:attr/textAppearanceLarge" android:text="Heading" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/textView3" android:textColor="@color/maincolors"></TextView>
</TableRow>
<TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content">
<Button android:text="Help" android:onClick="clickHelpButton" android:id="@+id/helpButton" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</TableRow>
<TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content"></TableRow>
</TableLayout>
<Button android:text="Done" android:id="@+id/done" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="clickDoneButton"></Button>
</LinearLayout>
Upvotes: 0
Views: 451
Reputation: 28162
Eclipse SDK view and the emulator doesn't always aggree with each other ;) but the emulator usually aggrees with devices :)
I'm not sure why your code acts up, ussually it is something to do with padding/margin but could also be the textapperancelarge thing (not used it myself). Also don't use margin="75px" really not recommended to use hard coded values like px, use sp instead. See What is the difference between "px", "dp", "dip" and "sp" on Android? for reference.
Upvotes: 1