Android XML按钮布局,形状宽度问题
我试图为我的按钮创建一个上部阴影,但这并没有占据底部的全部宽度(见下图,阴影在按钮内部为黑色) 我怎样才能修好它 非常感谢 XML可绘制(mybutton.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布局
<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" />