Android Layout: Why don't the TextView and a ToggleButton align

Posted by Ally on Stack Overflow See other posts from Stack Overflow or by Ally
Published on 2010-05-16T18:40:30Z Indexed on 2010/05/16 22:10 UTC
Read the original article Hit count: 310

I'm trying to put a TextView and a ToggleButton in a table row, however, they don't seem to align (The top of the button starts about 10px below the top of the textview even though the height each element is the same. Can anyone tell me why?

<TableLayout
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"

        >
    <TableRow>
        <AutoCompleteTextView
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:layout_weight="1"
        />

        <ToggleButton
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        />
        </TableRow>

        </TableLayout>

© Stack Overflow or respective owner

Related posts about android

Related posts about textview