我想要一個按鈕對齊的EditText框的底部和右側。Android - 對齊按鈕editview略微關閉
我的代碼如下:
<RelativeLayout
android:id="@+id/global_only_available_home_delivery_postcode_check_layout"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginTop="5dp"
android:layout_gravity="right"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/global_only_available_home_delivery_postcode_check_text_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/delivery_edit_hint"
android:layout_marginLeft="@dimen/pdp_status_delivery_margin_5"
android:layout_marginTop="@dimen/pdp_status_delivery_margin_10"
android:textSize="14sp"
android:inputType="text" />
<Button
android:id="@+id/fragment_pdp_deliverygo"
style="@style/alternatesmallbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="35dp"
android:minHeight="35dp"
android:layout_marginLeft="10dp"
android:text="@string/pdp_delivery_go"
android:layout_gravity="right"
android:layout_margin="5dp"
android:layout_toRightOf="@+id/global_only_available_home_delivery_postcode_check_text_phone"
android:layout_alignBottom="@+id/global_only_available_home_delivery_postcode_check_text_phone"
android:visibility="visible" />
</RelativeLayout>
,這裏是我所得到的button alignment
正如你可以從圖片看到,該按鈕似乎不對齊到TextView的底部。
任何人都可以幫忙嗎?
可悲的是它未工作,我仍然可以在bottem按鈕不對齊。它的奇怪,因爲在圖形視圖中,它很好地對齊,但在應用程序中,它並沒有 –
@AndrewMurphy試圖給出相對佈局的固定高度。 – Hariharan