![](/img/trans.png)
[英]How to remove internal Image padding (Top, Left and Bottom) of an Android Checkbox
[英]How to remove top padding from Bottom sheet in android?
我想我已經得到了答案。 只需要從android:fitsSystemWindows="true"
刪除android:fitsSystemWindows="true"
,即LinearLayout。 以防萬一我把xml
代碼放在下面。
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:id="@+id/coordinatorLayout"
tools:context=".MainActivity">
<include layout="@layout/content_main" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
android:id="@+id/bottom_sheet"
android:background="@android:color/holo_orange_light"
app:layout_behavior="@string/bottom_sheet_behavior"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:layout_weight="1"
android:layout_margin="@dimen/five"
android:padding="@dimen/ten"
android:src="@drawable/ic_photo_camera"
android:layout_width="@dimen/fifty"
android:layout_height="@dimen/fifty" />
<ImageView
android:layout_weight="1"
android:layout_margin="@dimen/five"
android:padding="@dimen/ten"
android:src="@drawable/ic_image_gallery"
android:layout_width="@dimen/fifty"
android:layout_height="@dimen/fifty" />
<ImageView
android:layout_weight="1"
android:layout_margin="@dimen/five"
android:padding="@dimen/ten"
android:src="@drawable/ic_video_camera"
android:layout_width="@dimen/fifty"
android:layout_height="@dimen/fifty" />
<ImageView
android:layout_weight="1"
android:layout_margin="@dimen/five"
android:padding="@dimen/ten"
android:src="@drawable/ic_video_camera"
android:layout_width="@dimen/fifty"
android:layout_height="@dimen/fifty" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
僅供我使用,我使用了不同的 drawable,您需要將其改回原來的。
我希望它有幫助!
您可以為底部工作表制作自定義視圖並在其中放置空格和邊距
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.