Один элемент заполняет весь экран, а другой становится невидимым?
Как сделать TextView
заполнить весь экран после Button
становится невидимым?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
Кнопка становится невидимой с помощью команды пункта меню
button.setVisibility(View.INVISIBLE);
1 ответ
Решение
Пытаться
button.setVisibility(View.GONE);
Цитата с этой страницы:
int GONE Этот вид невидим, и он не занимает места для макета.