在我的应用程序布局中,我有一个相对布局,其中连续包含 7 个按钮。现在我想在行的开头添加另一个按钮 (@+id/IB_Summe)。但在 GraphicalLayout 和我的设备上,前两个按钮(@+id/IB_Summe 和 @+id/ImageButton01)被覆盖。他们不是在旁边吗?我究竟做错了什么?
我的 xml 布局:
<RelativeLayout
android:id="@+id/Buttonleiste"
android:layout_width="fill_parent"
android:layout_height="120px"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:gravity="bottom|center_horizontal"
android:paddingTop="2dp"
android:paddingBottom="2dp" android:background="@drawable/gradient">
<Button
android:id="@+id/IB_Summe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/graph"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginRight="1dp"
android:background="@layout/selector_empty_square_on"
android:gravity="center_horizontal|bottom"
android:lines="1"
android:paddingBottom="10dp"
android:text="@string/summe_symbol"
android:textColor="@color/my_white"
android:textSize="30sp" />
<Button
android:id="@+id/ImageButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/IB_Summe"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginRight="1dp"
android:background="@layout/selector_empty_square_on"
android:gravity="center_horizontal|bottom"
android:lines="1"
android:paddingBottom="10dp"
android:text="@string/euro_symbol"
android:textColor="@color/my_white"
android:textSize="30sp" />
<Button
android:id="@+id/menuDiagram"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@id/ImageButton01"
android:background="@layout/selector_empty"
android:gravity="center_vertical|center_horizontal"
android:lines="1"
android:maxHeight="38dp"
android:text="@string/Hour"
android:textColor="@color/my_white"
android:textSize="30sp" />
<Button
android:id="@+id/menuExtrasButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@id/menuDiagram"
android:background="@layout/selector_empty"
android:gravity="center_vertical|center_horizontal"
android:lines="1"
android:maxHeight="38dp"
android:text="@string/Day"
android:textColor="@color/my_white"
android:textSize="30sp" />
<Button
android:id="@+id/menuInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@id/menuExtrasButton"
android:background="@layout/selector_empty"
android:gravity="center_vertical|center_horizontal"
android:lines="1"
android:maxHeight="38dp"
android:text="@string/Week"
android:textColor="@color/my_white"
android:textSize="30sp" />
<Button
android:id="@+id/menuCounter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@id/menuInfo"
android:background="@layout/selector_empty"
android:gravity="center_vertical|center_horizontal"
android:lines="1"
android:maxHeight="38dp"
android:text="@string/Month"
android:textColor="@color/my_white"
android:textSize="30sp" />
<Button
android:id="@+id/menuSetting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@id/menuCounter"
android:background="@layout/selector_empty"
android:gravity="center_vertical|center_horizontal"
android:lines="1"
android:maxHeight="38dp"
android:text="@string/Year"
android:textColor="@color/my_white"
android:textSize="30sp" />
<Button
android:id="@+id/menuTarif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_toRightOf="@id/menuSetting"
android:background="@layout/selector_empty_square"
android:gravity="bottom|center_horizontal"
android:paddingBottom="10dp"
android:lines="1"
android:maxHeight="38dp"
android:text="@string/kws_symbol"
android:textColor="@color/my_white"
android:textSize="30sp" />
</RelativeLayout>