2013-10-17 86 views
0

我正在编辑sipdroid http://code.google.com/p/sipdroid/和jsut想要将背景更改为自定义图像。默认情况下,它们是灰色的,整个屏幕都是灰色的,但是当我在背景中添加想象它们周围有一个白色边框时,为什么?我如何在styles.xml或其他地方更改它?背景图片周围的白色边框?

enter image description here

底部是图像的名字,之前我在拖加bototm则以线条阅读: android:background="#736f6e"

<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="@drawable/bottom"> 
<!--android:background="#736f6e"-->** 
    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_weight="1" 
      android:gravity="left" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      > 

      <LinearLayout 
       android:orientation="vertical" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:paddingLeft="15dip" 
       android:paddingRight="15dip" 
       android:paddingTop="15dip"> 

       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:textColor="#ffffff" 
        android:typeface="serif" 
        android:textStyle="bold|italic" 
        android:shadowDx="1" 
        android:shadowDy="1" 
        android:shadowRadius="1" 
        android:shadowColor="#aaaaaa" 
        android:textSize="28dip" 
        android:text="@string/app_name"/> 

       </LinearLayout> 
     </LinearLayout> 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_weight="0" 
      android:gravity="right" 
      android:paddingTop="10dip" 
      android:paddingLeft="10dip" 
      android:paddingRight="10dip" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"> 

      <Button 
       android:id="@+id/contacts_button" 
       android:drawableLeft="@drawable/ic_menu_dial_pad" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"/> 


     </LinearLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:paddingLeft="5dip" 
     android:paddingRight="5dip"> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:padding="5dip" > 

      <org.sipdroid.sipua.ui.InstantAutoCompleteTextView 
       android:id="@+id/txt_callee2" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:hint="@string/hint2" 
       android:imeOptions="actionSend" 
       android:inputType="phone" 
       android:singleLine="true" > 

       <requestFocus /> 
      </org.sipdroid.sipua.ui.InstantAutoCompleteTextView> 

      <org.sipdroid.sipua.ui.InstantAutoCompleteTextView 
       android:id="@+id/txt_callee" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:hint="@string/hint" 
       android:imeOptions="actionSend" 
       android:inputType="textEmailAddress" 
       android:singleLine="true" /> 

     </LinearLayout> 



    </LinearLayout> 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:background="@drawable/bottom" 
     android:gravity="bottom" 
     **android:orientation="vertical" > 
     <!-- android:background="#736f6e" -->** 


     <Button 
      android:id="@+id/create_button" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:text="@string/menu_create" /> 
    </LinearLayout> 


</LinearLayout> 
+0

你确定保证金不是你的形象的一部分?布局设置为填充父项,它可能只是有它周围的小填充(只是以为我会检查) – BTC

+0

奇怪,你是正确的,瘸子不显示白色边框,但我在图像查看器中打开,并可以看到它。 – Paul

+0

作为一个建议,可能不会帮助你的问题在这里,你应该真正考虑如何使用RelativeLayouts。您的视图嵌套非常深刻且不必要,这会导致性能下降并难以读取XML。 – dymmeh

回答

1

作为一个长期的解决方案Dymmeh是正确的。你应该看看RelativeLayouts。

对于这个问题,取决于你从GIMP中导出图像的大小以及图像相对于图层内容的大小,它将增加一个小的白色边缘。

请确保您的所有图层都等于图像的最大尺寸并以PNG平原形式导出。检查所有选项。

+0

谢谢你会看看:) – Paul