2011-04-02 104 views
1

我试图将背景图像放在我的android项目中的linearlayout。除了屏幕左侧和右侧的渐弱边缘之外,所有工作都很好。我的背景图片尺寸为52x602,原本没有这种淡化边缘。我想要背景图片覆盖所有区域。此外,它已由设计师完成,并使用我认为的9补丁(图像周围的黑色边框)。我怎样才能正确地设置背景没有这些边缘?具有褪色边缘的背景图像

在模拟器,所以它看起来是这样的:

enter image description here

XML:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/login_background" 
    android:orientation="vertical" 
    > 
</LinearLayout> 
+0

你的问题不是很清楚......你想消除左右两边的衰落吗?这不仅仅是一个简单的Photoshop /绘画工作? – 2011-04-02 21:07:37

+0

在我的背景图像中没有黑色的衰落边缘,所以我没有任何删除。 – evilone 2011-04-02 21:10:20

回答

1

好,我知道自己的回答。 .png文件必须以.9.png结尾,如果它们是9个补丁文件...所以如果有人会遇到同样的问题,那么你就会知道。

+0

谢谢你很多:) – Giordano 2015-01-12 15:01:50

0

尝试fadingEdge设置为none

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/login_background" 
    android:orientation="vertical" 
    android:fadingEdge="none" 
    > 
</LinearLayout> 
+1

试过,没有工作 – evilone 2011-04-02 21:24:15