剪辑按钮XML

时间:2014-03-05 14:46:46

标签: android xml android-xml

我有以下XML布局;     

    <TextView
        android:id="@+id/found_item_catnum_name"
        style="@style/qi_head_name_bubbles"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:text="@string/catalog_number" />

    <TextView
        android:id="@+id/found_item_catnum_value"
        android:layout_alignBaseline="@id/found_item_catnum_name"
        android:layout_toLeftOf="@id/found_item_catnum_name"
        style="@style/qi_head_val_bubbles" />

    <TextView
        android:id="@+id/found_item_committed_name"
        android:layout_below="@id/found_item_catnum_name"
        android:layout_alignRight="@id/found_item_catnum_name"
        style="@style/qi_head_name_bubbles"
        android:text="@string/committed2customer" />

     <TextView
        android:id="@+id/found_item_committed_val"
        android:layout_alignBaseline="@id/found_item_committed_name"
        android:layout_toLeftOf="@id/found_item_committed_name"
        style="@style/qi_head_val_bubbles" />

     <TextView
        android:id="@+id/found_item_stock_name"
        android:layout_below="@id/found_item_committed_name"
        android:layout_alignRight="@id/found_item_committed_name"
        style="@style/qi_head_name_bubbles"
        android:text="@string/available_stock"/>

    <TextView
        android:id="@+id/found_item_stock_value"
        style="@style/qi_head_val_bubbles"
        android:layout_alignBaseline="@id/found_item_stock_name"
        android:layout_toLeftOf="@id/found_item_stock_name"
        android:paddingLeft="@dimen/medium_margin" />

    <Button 
        android:id="@+id/expand_stock_button"
        android:layout_height="@dimen/search_btn_dim"
        android:layout_width="@dimen/search_btn_dim"
        android:layout_alignBaseline="@id/found_item_stock_value"
        android:layout_toLeftOf="@id/found_item_stock_value"
        android:background="@drawable/add_button"/>


</RelativeLayout>

布局末尾定义的按钮的下边缘被剪裁,如Eclipse图形布局渲染图像中所示: Clipped button

我真的无法理解导致裁剪的原因。父布局的边框没有这样做,如渲染工具添加的蓝色边框所示。任何线索将不胜感激

1 个答案:

答案 0 :(得分:1)

尝试添加保证金,例如:android:layout_marginBottom="10dp

 <Button 
        android:id="@+id/expand_stock_button"
        android:layout_height="@dimen/search_btn_dim"
        android:layout_width="@dimen/search_btn_dim"
        android:layout_alignBaseline="@id/found_item_stock_value"
        android:layout_toLeftOf="@id/found_item_stock_value"
         android:layout_marginBottom="10dp"
        android:background="@drawable/add_button"/>