Android 在对话框中剪切视图

Android 在对话框中剪切视图,android,android-layout,android-view,android-alertdialog,Android,Android Layout,Android View,Android Alertdialog,您好,我想在对话框中显示三个按钮,但最后一个按钮的一侧正在剪切图片如下 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:layout_width=

您好,我想在对话框中显示三个按钮,但最后一个按钮的一侧正在剪切图片如下

      <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
  android:layout_width="@dimen/dialog_width"
  android:layout_height="match_parent"
  android:background="@android:color/white"
   android:orientation="vertical" >

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/textViewEng"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:padding="@dimen/medium"
            android:textColor="@color/blue"
            android:textSize="@dimen/extra_large_text"
            android:textStyle="bold" >
        </TextView>

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="@dimen/medium"
            android:src="@drawable/grey_dots" />

        <com.dictionarylib.widget.GujTextView
            android:id="@+id/textViewGuj"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:textColor="@android:color/black"
            android:textSize="@dimen/extra_large_text"
            android:textStyle="bold" />

        <LinearLayout
            android:id="@+id/llListDetailImage"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/small"
            android:background="@drawable/light_blue_rounded"
            android:gravity="center_horizontal" >

            <ImageView
                android:id="@+id/ivListDetail1"
                android:layout_width="@dimen/dialog_image_width"
                android:layout_height="@dimen/dialog_image_width"
                android:layout_marginBottom="@dimen/small"
                android:layout_marginLeft="@dimen/small"
                android:layout_marginTop="@dimen/small"
                android:background="@drawable/white_rounded"
                android:src="@drawable/ic_launcher" />

            <ImageView
                android:id="@+id/ivListDetail2"
                android:layout_width="@dimen/dialog_image_width"
                android:layout_height="@dimen/dialog_image_width"
                android:layout_marginBottom="@dimen/small"
                android:layout_marginLeft="@dimen/small"
                android:layout_marginTop="@dimen/small"
                android:background="@drawable/white_rounded"
                android:src="@drawable/ic_launcher" />

            <ImageView
                android:id="@+id/ivListDetail3"
                android:layout_width="@dimen/dialog_image_width"
                android:layout_height="@dimen/dialog_image_width"
                android:layout_marginBottom="@dimen/small"
                android:layout_marginLeft="@dimen/small"
                android:layout_marginTop="@dimen/small"
                android:background="@drawable/white_rounded"
                android:src="@drawable/ic_launcher" />

            <ImageView
                android:id="@+id/ivListDetail4"
                android:layout_width="@dimen/dialog_image_width"
                android:layout_height="@dimen/dialog_image_width"
                android:layout_marginBottom="@dimen/small"
                android:layout_marginLeft="@dimen/small"
                android:layout_marginRight="@dimen/small"
                android:layout_marginTop="@dimen/small"
                android:background="@drawable/white_rounded"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/medium"
            android:gravity="center_horizontal"
            android:orientation="horizontal"
            android:padding="@dimen/extra_small" >

            <Button
                android:id="@+id/btnListDetailFavorite"
                style="@style/white_medium"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="@drawable/yellow_rounded"
                android:drawableLeft="@drawable/dialog_favorite"
                android:minHeight="0dp"
                android:minWidth="0dp"
                android:paddingBottom="@dimen/extra_small"
                android:paddingTop="@dimen/extra_small"
                android:text="@string/favorite" />

            <Button
                android:id="@+id/btnListDetailSound"
                style="@style/white_medium"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/extra_small"
                android:layout_marginRight="@dimen/extra_small"
                android:layout_weight="1"
                android:background="@drawable/apple_green_rounded"
                android:drawableLeft="@drawable/dialog_sound"
                android:minHeight="0dp"
                android:minWidth="0dp"
                android:paddingBottom="@dimen/extra_small"
                android:paddingTop="@dimen/extra_small"
                android:text="@string/sound" />

            <Button
                android:id="@+id/btnListDetailShare"
                style="@style/white_medium"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="@drawable/ribbon_blue_rounded"
                android:drawableLeft="@drawable/dialog_share"
                android:minHeight="0dp"
                android:minWidth="0dp"
                android:paddingBottom="@dimen/extra_small"
                android:paddingTop="@dimen/extra_small"
                android:text="@string/share" />
        </LinearLayout>
    </LinearLayout>
</ScrollView>

有人知道如何防止按钮被剪切吗,我已经把全部xml文件放进去了,因为解算器可以理解全部内容

尝试给按钮留出空白,我在这里给出示例,您可以在布局中随意增减值

 <Button
                android:id="@+id/btnListDetailShare"
                style="@style/white_medium"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="4dp"
                android:background="@drawable/ribbon_blue_rounded"
                android:drawableLeft="@drawable/dialog_share"
                android:minHeight="0dp"
                android:minWidth="0dp"
                android:paddingBottom="@dimen/extra_small"
                android:paddingTop="@dimen/extra_small"
                android:text="@string/share" />
并给予

安卓:布局_marginLeft和 android:layout_margin其他两个按钮的正确值也是正确的,而且android:layout_weight=1也会产生问题,所以请删除该按钮,或者给出适合您屏幕的小于1的值