Затененная область на экране - PullRequest
2 голосов
/ 12 декабря 2011

Почему я получаю заштрихованную область на моем экране, я поместил линейный макет в Относительный макет.

Вот мой 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 ]

3 голосов
/ 04 января 2012

Внесите следующие изменения в ваш код.

В файле XML:

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

и в файле Java:

ImageButton.setBackgroundColor(Color.TRANSPARENT);
0 голосов
/ 12 декабря 2011

Вместо

android:background="@drawable/trans"

Используйте это:

android:background="@android:color/transparent"
0 голосов
/ 12 декабря 2011

Это потому, что вы использовали:

android:background="@drawable/trans"

в линейном макете.
Если вы не хотите, вы можете удалить эту строку.Или, если вы хотите другой цвет, вы можете изменить его.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...