1
我有一个relativelayout
与2 ImageButtons
和2 spinner
。所有的都是aligne垂直居中。现在当paddingBottom
到relativelayout
旋钮和按钮被切断。按钮和旋钮的底部不会在这里被切断。android添加填充布局削减布局中的项目
这是我的代码
<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>
没有人知道为什么会这样?
请粘贴相关布局的属性 – Michal
添加属性是相对布局 –
所以你应该使用wrap_content的微调因为它只是不能适应30dp或使用自定义绘制背景的微调这将适合30dp – Michal