android在布局中添加填充将剪切布局中的项目

android在布局中添加填充将剪切布局中的项目,android,android-layout,Android,Android Layout,我有一个带有2个imagebutton和2个spinner的relativelayout。所有都将与中心垂直对齐。现在,当paddingBottom到relativelayout时,微调器和按钮被切断。按钮和微调器的底部不在此切割 这是我的密码 <RelativeLayout android:id="@+id/rellayout" android:layout_width="match_parent" android

我有一个带有2个
imagebutton
和2个
spinner
relativelayout
。所有都将与中心垂直对齐。现在,当
paddingBottom
relativelayout
时,微调器和按钮被切断。按钮和微调器的底部不在此切割

这是我的密码

<RelativeLayout
            android:id="@+id/rellayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:paddingBottom="20dp">

            <ImageButton
                android:id="@+id/imgshare"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:background="@android:color/transparent"
                android:paddingRight="5dp"
                android:src="@drawable/share" />

            <ImageButton
                android:id="@+id/imageButtonLocation"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:background="@android:color/transparent"
                android:padding="5dp"
                android:src="@drawable/location_icon" />

            <Spinner
                android:id="@+id/spnrprivacy"
                android:layout_width="100dp"
                android:layout_height="30dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_toRightOf="@id/imageButtonLocation"
                android:background="@drawable/dropdown" />

            <Spinner
                android:id="@+id/spnrtitbits"
                android:layout_width="100dp"
                android:layout_height="30dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_toRightOf="@id/spnrprivacy"
                android:background="@drawable/dropdown" />
        </RelativeLayout>


有人知道为什么会这样吗

更改微调器的固定高度
“30dp”
并使其
包裹内容物
。这可能在设备中表现不同

ANS:


您可以将
MarginBottom
设置为类似儿童的微调器,而不是将
PaddingBottom
设置为parent。没有
RelativeLayout的属性
这就是我能给客人的建议

请,粘贴RelativeLayout的属性添加的属性是relative layout,因此您应该为微调器使用wrap_内容,因为它无法适应30dp,或者为微调器使用自定义的可绘制背景,以适应30dp。是的,我知道我可以为布局内的元素使用MarginBottom。但我需要知道为什么要削减布局。