1

Когда я поворачиваю мой экран в режим пейзажа, DialogFragment содержащей этот макет будет отрезав две кнопки в нижней части:Кнопки получения отрезана во вращение ландшафтного (Android XML)

<?xml version="1.0" encoding="utf-8"?> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:tools="http://schemas.android.com/tools" 
       android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:padding="4dp"> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Alias"/> 

    <EditText 
     android:id="@+id/edittext_alias" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="textCapWords" 
     android:ems="10" 
     android:layout_marginLeft="4dp" 
     android:maxLength="30" 
     android:imeOptions="actionDone"/> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Interests"/> 

    <EditText 
     android:id="@+id/edittext_interests" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="text" 
     android:ems="10" 
     android:layout_marginLeft="4dp" 
     android:maxLength="10" 
     android:imeOptions="actionDone"/> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Bio"/> 

    <EditText 
     android:id="@+id/edittext_bio" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="textCapSentences" 
     android:ems="10" 
     android:layout_marginLeft="4dp" 
     android:maxLines="2" 
     android:gravity="top" 
     android:imeOptions="actionDone" 
     android:requiresFadingEdge="vertical" 
     android:fadingEdgeLength="20dp" 
     android:scrollbars="vertical" 
     android:fadeScrollbars="false"/> 

    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <Button 
      android:id="@+id/button_cancel" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:text="Cancel" 
      android:layout_weight="1"/> 

     <Button 
      android:id="@+id/button_confirm" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:text="OK" 
      android:layout_gravity="center_horizontal" 
      android:layout_weight="1"/> 
    </LinearLayout> 

</LinearLayout> 

я делаю что-то неправильно или отсутствует что-то очевидное? Как я могу заставить его отображать все?

+0

Можете ли вы показать макет XML, где 'Fragment' включен? Возможно, вам придется создать выделенный макет для ландшафтной ориентации. Затем вы помещаете такой файл макета в 'res/layout-land'. – ishmaelMakitla

+0

Это DialogFragment, поэтому он всплывает над экраном сам по себе. Этот макет уже реализуется в 'res/layout-land'. – user6419910

ответ

1

Я думаю, что ваш экран просто недостаточно велик, чтобы показать весь контент. Android не добавляет функции прокрутки, если контент больше экрана. Если это так, оберните все ваши взгляды в ScrollView, чтобы кнопки могли быть видны после прокрутки. Как это:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:padding="4dp"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <!-- Putt all your view here --> 

     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 
0

Также вы можете положить Scrollview в качестве Вашего родительского вида

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:tools="http://schemas.android.com/tools" 
       android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <!-- Putt all your view here --> 

     </LinearLayout> 
    </ScrollView>