Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android XML按钮布局,形状宽度问题_Android_Layout_Shape_Android Drawable_Layer List - Fatal编程技术网

Android XML按钮布局,形状宽度问题

Android XML按钮布局,形状宽度问题,android,layout,shape,android-drawable,layer-list,Android,Layout,Shape,Android Drawable,Layer List,我试图为我的按钮创建一个上部阴影,但这并没有占据底部的全部宽度(见下图,阴影在按钮内部为黑色) 我怎样才能修好它 非常感谢 XML可绘制(mybutton.XML) XML布局 <Button android:layout_width="100dip" android:layout_height="wrap_content" android:layout_marginBottom="10dip"

我试图为我的按钮创建一个上部阴影,但这并没有占据底部的全部宽度(见下图,阴影在按钮内部为黑色)

我怎样才能修好它

非常感谢

XML可绘制(mybutton.XML)


XML布局

        <Button
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/mybutton"
            android:paddingBottom="5dip"
            android:paddingTop="5dip"
            android:text="Info"
            android:textColor="#ffffff" />


将您的xml代码张贴到xml已经存在的位置!啊,好的,现在就发吧!您是否尝试过移除所有填充物,然后逐个添加以获得所需的结果?是的,第一个形状中的填充物也会影响第二个形状。。。这是正确的吗?从第一个形状中移除填充物解决了我的问题,但我如何也保留填充物呢?
        <Button
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/mybutton"
            android:paddingBottom="5dip"
            android:paddingTop="5dip"
            android:text="Info"
            android:textColor="#ffffff" />