Above is the screen shot of my apps Dashboard screen. Each of the Dash board item is a Linear Layout which i have made clickable and have applied the background.xml on OnClick event to show a different background color on click. The problem i am having is the extra grey line at the top of Purcahse History.
而且我坚持了很久。
这是我的background.xml文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@drawable/bgColorButtonClick" />
<stroke android:width="1dp" android:color="@drawable/llBorderColor" />
<padding android:left="15dp" android:top="15dp" android:right="15dp" android:bottom="15dp" />
</shape>
非常感谢任何帮助。 提前致谢。
最佳答案
我认为问题在于您的 background.xml 文件中的笔划。
为什么不以编程方式设置不同的背景颜色呢?例如
layout.setBackgroundColor(Color.DKGRAY);
关于android - 线性布局 (Android) 上的边框问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15558241/