2012-06-08 6 views
0

Я пробовал все возможные варианты для android:background и android:cacheColorHint с @android:color/transparent и @null, но не использовать, чтобы скрыть списокView на картинке.ListView не занимает весь экран

Я пытаюсь объединить серый фон (розовые вопросительные знаки) с белой темой моего приложения.

Моя тема является регулярным @android:style/Theme.Light.NoTitleBar

Мой код раскладка

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@android:color/transparent" > 

    <LinearLayout 
     android:id="@+id/header" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:weightSum="1" > 

     <ImageView 
      android:id="@+id/abcIcon" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical|center_horizontal" 
      android:layout_weight="0.15" 
      android:contentDescription="@string/abcIcon" 
      android:scaleType="centerInside" 
      android:src="@drawable/abc" /> 

     <TextView 
      android:id="@+id/title" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical|center_horizontal" 
      android:layout_weight="0.70" 
      android:text="@string/app_name" 
      android:textSize="@dimen/headertextsize" /> 

     <ImageView 
      android:id="@+id/search" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical|center_horizontal" 
      android:layout_weight="0.15" 
      android:contentDescription="@string/abcIcon" 
      android:src="@drawable/search" /> 
    </LinearLayout> 

    <RelativeLayout 
     android:id="@+id/followupHeaderLayout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/header" 
     android:layout_gravity="center_horizontal" > 

     <RelativeLayout 
      android:id="@+id/followupHeaderRelativeLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="10dp" > 

      <ImageView 
       android:id="@+id/leftArrow" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerVertical="true" 
       android:contentDescription="@string/abcIcon" 
       android:src="@drawable/leftarrow" /> 

      <TextView 
       android:id="@+id/followupHeaderText" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_toRightOf="@id/leftArrow" 
       android:text="@string/followup" 
       android:textSize="@dimen/headertextsize" /> 
     </RelativeLayout> 

     <TextView 
      android:id="@+id/followupDescriptionText" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/followupHeaderRelativeLayout" 
      android:layout_centerInParent="true" 
      android:padding="10dp" 
      android:text="@string/followupdescription" 
      android:textSize="@dimen/normaltextsize" /> 
    </RelativeLayout> 

    <TextView 
     android:id="@+id/listViewHeaderText" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/followupHeaderLayout" 
     android:layout_marginLeft="10dp" 
     android:text="@string/typeofAppt" 
     android:textSize="@dimen/normaltextsize" /> 

    <RelativeLayout 
     android:id="@+id/declarationLayout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_marginBottom="10dp" > 

     <TextView 
      android:id="@+id/widgetLabel" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="10dp" 
      android:text="@string/declarationCompletion" 
      android:textColor="@android:color/black" 
      android:textSize="@dimen/normaltextsize" /> 

     <Button 
      android:id="@+id/doneButton" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/widgetLabel" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="15dp" 
      android:background="#436EEE" 
      android:gravity="left" 
      android:paddingBottom="10dp" 
      android:paddingLeft="5dp" 
      android:paddingTop="10dp" 
      android:text="@string/doneWithFollowup" 
      android:textColor="@android:color/white" 
      android:textSize="@dimen/normaltextsize" /> 
    </RelativeLayout> 

    <ListView 
     android:id="@+id/listViewFollowup" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_above="@id/declarationLayout" 
     android:layout_below="@id/listViewHeaderText" 
     android:background="@android:color/transparent" 
     android:cacheColorHint="@null" 
     android:choiceMode="singleChoice" /> 

</RelativeLayout> 

Любые намеки?

enter image description here

+0

показать ваш файл макета. –

+0

Вы используете scrollView в качестве родительского макета для этого спискаView? Coz, использующий ScrollView и список вместе, вызывает такую ​​проблему ... – Shrikant

+0

Нет, я нет. – Sana

ответ

1

Единственное решение, которое я знаю, чтобы создать кнопку с шириной 1 dp и высоту, как вам нужно, и положение это один по списку, чтобы заполнить все остальное.

Я заранее извиняюсь за этот довольно «грязный» совет, но, как вы, я продолжаю сталкиваться с такой проблемой, пробовал нижние_магины, прокладки, фиксированные размеры фона, .. Я не нашел никаких «чистых», решение.

С нетерпением ожидаем лучших рабочих предложений по этой теме :-)

Смежные вопросы