如果我在水平 LinearLayout 或表格行中添加微调器,例如:
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
</EditText>
<Spinner
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
微调器向下 float 。它在 android 2.2、android 2.3 和 android 3.2 上 float ,但在 android 4.0 中运行良好,他们修复了它。但是有没有办法让它与其他 View 对齐,比如 Android 2.3 上的 EditText。
我的意思是:
***********************
* if EditText is here * ************************
*********************** * Spinner will be here *
************************
最佳答案
旧帖子,但可能有帮助:
将 baselineAligned 设置为 true 是不必要的,因为它是默认值(此处解释: http://developer.android.com/reference/android/widget/LinearLayout.html#attr_android:baselinealigned )
我已经通过将高度硬编码到 textview 和微调器并将 baselineAligned 设置为 FALSE 来修复它。
关于android - 水平对齐时微调器向下 float ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8581607/