我正在尝试将TextView和ToggleButton放在一行表格中,但它们似乎无法对齐(即使每个元素的高度相同,按钮的顶部离文本视图的顶部约有10像素的差距)。有人能告诉我为什么吗?
<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>