2011-12-12 105 views
2

为什么我在屏幕上显示阴影区域,我已将线性布局放入相对布局中。屏幕上的阴影区域

这里是我的xml对应于该屏幕

I am grtting the shaded region in backround of buttons,I want to remove that shaded region... How to remove that

<?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout 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/bg" 

     android:id="@+id/mainlayout"> 

    <LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
     android:layout_width="175dip" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:background="@drawable/trans" 
     android:id="@+id/innerlayoutmain" 

     > 

     <ImageButton 
     android:layout_width="fill_parent" 
     android:layout_height="35dip" 
     android:id="@+id/sleepEasilyMeditationButton1" 
     android:gravity="center_horizontal" 
     android:layout_marginLeft="30dip" 
     android:textColor="@color/titletextcolor" 
     android:text="Sleep Easily Meditation" 
     ></ImageButton> 

     <ImageButton 
     android:paddingTop="10dip" 
     android:layout_width="fill_parent" 
     android:layout_height="25dip" 
     android:id="@+id/howToUseButton1" 
     android:gravity="center_horizontal" 
     android:layout_marginLeft="30dip" 
     android:textColor="@color/titletextcolor" 
     android:text="How to Use This App" 
     ></ImageButton> 

     <ImageButton 
     android:layout_width="fill_parent" 
     android:layout_height="25dip" 
     android:id="@+id/aboutShazzileandAliButton1" 
     android:gravity="center_horizontal" 
     android:layout_marginLeft="30dip" 
     android:textColor="@color/titletextcolor" 
     android:text="Abount Shazzie and Ali" 
     ></ImageButton> 

     <ImageButton 
     android:layout_width="fill_parent" 
     android:layout_height="25dip" 
     android:id="@+id/divinityPublishingHomeButton1" 
     android:gravity="center_horizontal" 
     android:layout_marginLeft="30dip" 
     android:textColor="@color/titletextcolor" 
     android:text="Divinity Publishing Home" 
     ></ImageButton> 


     <ImageButton 
     android:layout_width="fill_parent" 
     android:layout_height="25dip" 
     android:id="@+id/shareThisAppButton1" 
     android:gravity="center_horizontal" 
     android:layout_marginLeft="30dip" 
     android:textColor="@color/titletextcolor" 
     android:text="Share This App" 
     ></ImageButton> 
     </LinearLayout> 
    </RelativeLayout> 

我正在屏幕上阴影区域。

我把线性布局放在相对布局里面。

我改变了屏幕分辨率。

回答

3

不要在你的代码如下修改。

在XML文件:

android:background="@android:color/transparent" 

,并在你的java文件:

ImageButton.setBackgroundColor(Color.TRANSPARENT); 
0

那是因为你使用:

android:background="@drawable/trans" 
线性布局


如果你不想要,你可以删除这一行。或者,如果你想要一种不同的颜色,你可以改变它。

+0

我删除从XML文件中的声明,但它不工作 –

+0

在Java代码中,你使用的LinearLayout LL = findViewById(); then next ll.setBackground(Some value);如果是,则在代码中删除此行,也就是ll.setBackground。 – Sai

+0

@Suraj Shinde:清理并建立你的项目,然后再次运行。 –

0

而不是

android:background="@drawable/trans" 

使用此:

android:background="@android:color/transparent" 
+0

android:background =“@ android:color/transparent”我也试过这个,但它不起作用 –