2010-11-16 73 views
0

我有一个垂直方向的LinearLayout,有一个孩子LinearLayout包括TextView,一个EditTextButton,和一个孩子ImageView删除ImageView的边界

因此,像:

<LinearLayout> 
    <LinearLayout> 
     <TextView> 
     <EditText> 
     <Button> 
    <ImageView> 

而且我遇到的问题是,的LinearLayout和ImageView的之间的分离 - (显示巴纽作为与Android背景:背景=“@绘制/太阳” )在它们之间显示可见的折痕。我有LinearLayout使用与.png相同的背景颜色,使它看起来像它们一起流动,但折痕会破坏该方面。

编辑:这是截图!

alt text

你看到提交按钮下的细线?

这里是XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@color/lightblue" 

    > 
    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/welcome" 
     android:textSize="17sp" 
     android:textColor="@color/black" 
    /> 
    <EditText 
     android:id="@+id/entry" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:hint="@string/hint_text" 
     android:textSize="25sp" 
     android:inputType="text" 
    /> 
    <Button 
     android:id="@+id/submitButton" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:textSize="25sp" 
     android:text="Submit" 
    /> 
    <FrameLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:paddingTop="0px" 
    > 
    <ImageView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:background="@drawable/sunclouds" 
     android:layout_marginBottom="20dip"/> 
    <TextView 
     android:id="@+id/marq" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="10dip" 
     android:layout_gravity="center_horizontal|bottom" 
     android:textColor="@color/black" 
     android:text="@string/provider" 
     android:marqueeRepeatLimit="marquee_forever" 
     android:ellipsize="marquee" 
     android:focusable="true" 
     android:focusableInTouchMode="true" 
     android:singleLine="true" 
     android:scrollHorizontally="true" 

     /> 
    </FrameLayout> 

</LinearLayout> 

我怎样才能解决这个问题?

(侧面说明,我的太阳和云有粗糙的边缘,任何快速修补GIMP?)

+0

@PetrakovichJ:屏幕截图肯定有帮助。顺便说一下,您是否正确创建了PNG图像?有时候会发生这种情况,如果在将其导出为PNG文件时未删除图像的边框。 – Legend 2010-11-16 07:41:18

+0

@Legend:该图像最初是一个jpg,我用gimp把它保存为png。我认为这不是你所指的问题,因为边界线只在图像的顶部。 – joepetrakovich 2010-11-16 08:11:34

+1

@PetrakovichJ:我明白了..在这种情况下,如果ImageView是在LinearLayout的后台设置为png文件之后发生的,那么可能会发生这种情况。我会检查边框对于原始PNG背景图像是否可见。您是否有机会为内部LinearLayout设置背景?另外,你可以把你正在使用的确切的XML?随意放置只有相关的部分,因为这将有助于调试。至于瘸子的东西,我使用了不同的软件包,但如果有抗锯齿的选项,这可能会有所帮助。但是,它又取决于原始的JPG质量。 – Legend 2010-11-16 08:22:26

回答

2

至于有人参考谁没有耐心去通过的意见,真正的问题是,导出的图像有一条OP已经纠正的细线。无论如何,下面列出了发生这种情况的原因:

  • 导出的图像有细线 - 通常可以通过在线上绘制一个小矩形来解决。如果没有,然后切片1px版本的图像,并把它放在这一行的顶部来掩盖它。它一般工作正常。
  • 如果您设置线条颜色,则导出时 - 要解决此问题,请删除线条颜色。将其设置为与图像相同的颜色或将其完全移除。
+0

感谢您的总结。 – Signcodeindie 2013-04-04 12:14:50