2017-03-13 20 views
0

アプリをランドスケープモードで表示すると、以下のように表示されます。登録ボタンが切れています。私はAndroidを学び始めました。ランドスケープモードでの表示時の問題

enter image description here

私のXMLコードが

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/activity_register" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="com.bugmanagement.pankaj.androidexample.Activities.UserManagement.Auth.RegisterActivity"> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblEmailAddress" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
     <EditText 
      android:id="@+id/txtEmailAddress" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="@string/hint_email" 
      android:inputType="textEmailAddress" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblUserName" 
     android:layout_width="match_parent" 
     android:layout_below="@id/lblEmailAddress" 
     android:layout_height="wrap_content"> 
     <EditText 
      android:id="@+id/txtUserName" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="@string/hint_email" 
      android:inputType="text" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblPassword" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/lblUserName"> 
     <EditText 
      android:id="@+id/txtPassword" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="45dp" 
      android:hint="@string/hint_password" 
      android:inputType="textPassword" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblPasswordConfirmation" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/lblPassword"> 
     <EditText 
      android:id="@+id/txtPasswordConfirmation" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="45dp" 
      android:hint="@string/hint_passwordConfirmation" 
      android:inputType="textPassword" /> 
    </android.support.design.widget.TextInputLayout> 

    <Button 
     android:id="@+id/btnRegister" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentStart="true" 
     android:layout_below="@+id/lblPasswordConfirmation" 
     android:text="Register" /> 

    <Button 
     android:id="@+id/btnNavigateToLogin" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentStart="true" 
     android:layout_below="@+id/btnRegister" 
     android:text="Login" /> 

    <ProgressBar 
     style="?android:attr/progressBarStyleSmall" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/btnNavigateToLogin" 
     android:layout_centerHorizontal="true" 
     android:id="@+id/progressBarRegister" /> 

</RelativeLayout> 

を下回っている私は何も足りませんか?

+0

それはScrollView – Shekhar

答えて

2

Try wrapping your layout in a ScrollView

これはあなたのレイアウトをスクロール可能になります

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/activity_register" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="com.bugmanagement.pankaj.androidexample.Activities.UserManagement.Auth.RegisterActivity"> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblEmailAddress" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
     <EditText 
      android:id="@+id/txtEmailAddress" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="@string/hint_email" 
      android:inputType="textEmailAddress" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblUserName" 
     android:layout_width="match_parent" 
     android:layout_below="@id/lblEmailAddress" 
     android:layout_height="wrap_content"> 
     <EditText 
      android:id="@+id/txtUserName" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="@string/hint_email" 
      android:inputType="text" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblPassword" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/lblUserName"> 
     <EditText 
      android:id="@+id/txtPassword" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="45dp" 
      android:hint="@string/hint_password" 
      android:inputType="textPassword" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
     android:id="@+id/lblPasswordConfirmation" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/lblPassword"> 
     <EditText 
      android:id="@+id/txtPasswordConfirmation" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="45dp" 
      android:hint="@string/hint_passwordConfirmation" 
      android:inputType="textPassword" /> 
    </android.support.design.widget.TextInputLayout> 

    <Button 
     android:id="@+id/btnRegister" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentStart="true" 
     android:layout_below="@+id/lblPasswordConfirmation" 
     android:text="Register" /> 

    <Button 
     android:id="@+id/btnNavigateToLogin" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentStart="true" 
     android:layout_below="@+id/btnRegister" 
     android:text="Login" /> 

    <ProgressBar 
     style="?android:attr/progressBarStyleSmall" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/btnNavigateToLogin" 
     android:layout_centerHorizontal="true" 
     android:id="@+id/progressBarRegister" /> 

    </RelativeLayout> 
</ScrollView> 
+0

にuが正しいXMLを送ることができます作りますか?それは毎回アプリを終了します。いくつかの問題が起こっているようです。 – Pankaj

+0

私の更新された回答を確認してください –

+0

ありがとうございます。最高の答え。アップフォートされ承認された – Pankaj

関連する問題