我試圖排列至少三ImageButton的屬性android:layout_marginLeft="10dp"
是工作,但android:layout_marginBottom="10dp"
不工作,我無法找出問題,請人幫助我...在此先感謝ImageButtons沒有得到一致
activity_main.xml中是:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
tools:context=".MainActivity" >
<fragment
android:id="@+id/map_fragment"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="350dp"
android:layout_height="40dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="20dp"
android:background="@drawable/card_for_edittext" >
<ImageButton
android:id="@+id/button_go"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@android:color/transparent"
android:contentDescription="@string/save_button"
android:src="@drawable/ic_save" />
<View
android:layout_width="0.5dp"
android:layout_height="20dp"
android:layout_alignBottom="@+id/button_go"
android:layout_marginBottom="9dp"
android:layout_marginLeft="15dp"
android:layout_toLeftOf="@+id/button_go"
android:background="@android:color/darker_gray" />
<EditText
android:id="@+id/enteraddress"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="@android:color/transparent"
android:ems="10"
android:hint="@string/enter_address" >
</EditText>
</RelativeLayout>
<ImageButton
android:id="@+id/btnCurrentLocation"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:background="@drawable/box_96"
android:contentDescription="@string/mapView_Button"
android:src="@drawable/ic_current_location" />
<ImageButton
android:id="@+id/btnRefresh"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="14dp"
android:background="@drawable/box_96"
android:contentDescription="@string/refresh_button"
android:src="@drawable/ic_refresh"
android:text="@string/refresh_button" />
<ImageButton
android:id="@+id/btnListview"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/box_96"
android:contentDescription="@string/mapView_Button"
android:src="@drawable/ic_location_list" />
</RelativeLayout>
感謝您通知... eclipse不會在圖形佈局中顯示應用或更改的參數,雖然我可以在真實設備上看到這些更改 –
@RBM的樂趣。 :) – SilentKiller