Представления с видимостью Прошли, кажется, занимают место все еще - PullRequest
3 голосов
/ 19 января 2011

У меня есть диалоговое окно Layout, в котором есть несколько представлений, которые инициализированы как Visibility Gone.Тем не менее, пространство для каждого из представлений по-прежнему выделяется, что приводит к очень большому промежутку между двумя верхними постоянными представлениями и нижней кнопкой.

Если у кого-то есть идеи, которые были бы великолепны.

<?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="wrap_content">
  <Spinner 
    android:id="@+id/SearchTypeSpinner" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent"
    android:prompt="@string/SearchPrompt"
    android:entries="@array/SearchTypes">
    </Spinner>
  <EditText
    android:id="@+id/SearchText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/SearchTypeSpinner"
    android:imeOptions="actionDone">
    </EditText>
  <TextView
    android:id="@+id/RadiusLabel"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Search Radius"
    android:layout_below="@+id/SearchText"
    android:visibility="gone"
    style="@style/headerText">
    </TextView>
  <EditText
    android:id="@+id/RadiusText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/RadiusLabel"
    android:visibility="gone"
    android:imeOptions="actionDone">
    </EditText>
  <Spinner
    android:id="@+id/StateSpinner"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/RadiusText"
    android:entries="@array/states"
    android:prompt="@string/StatePrompt"
    android:visibility="gone">
    </Spinner>
     <Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/ShowResultsButton"
    android:text="Show Results"
    android:layout_alignBottom="true">
    </Button>
</RelativeLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...