Ограничить количество строк списка
Я разрабатываю приложение, которое должно быть сопряжено с другими устройствами через Bluetooth. У меня были проблемы с тем, чтобы правильно показать список сопряженных устройств. Я также рассмотрел пример в Android API (Bluetooth-чат), но у меня была та же проблема.
Список сопряженных устройств слишком большой, а затем скрывается кнопка поиска, расположенная внизу списка.
Мой XML-код очень похож на пример:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView android:id="@+id/listpaired_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/title_paired_devices"
android:visibility="gone"
android:background="#666"
android:textColor="#fff"
android:paddingLeft="5dp"
/>
<ListView android:id="@+id/paired_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stackFromBottom="true"
android:layout_weight="1"
/>
<TextView android:id="@+id/list_new_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/title_other_devices"
android:visibility="gone"
/>
<ListView android:id="@+id/new_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stackFromBottom="true"
android:layout_weight="2"
/>
<Button android:id="@+id/btscan"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btscan"
/>
</LinearLayout>
Но и я не могу показать кнопку поиска внизу. Вот мой экран:Мой экран
Вы могли видеть немного кнопки внизу диалогового окна.
Можно ли ограничить количество строк, отображаемых в списке? Может кто-нибудь сказать мне, как я могу решить эту проблему