2016-07-28 7 views
1

Ran in einen seltsamen Fehler, wo TextView 's (Login_Message) Text EditText' s (Benutzername) Text ist, der darunter ist.TextView fullen EditText darunter

Meine Layoutdatei anhängen.

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     xmlns:tools="http://schemas.android.com/tools" 
     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" 
     android:orientation="vertical" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" 
     tools:showIn="@layout/activity_login"> 
     <TextView 
      android:id="@+id/login_error" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:visibility="invisible"/> 

     <TextView 
      android:id="@+id/login_message" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:textStyle="bold"/> 

     <EditText 
      android:id="@+id/username" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="Enter your username here"/> 
     <EditText 
      android:id="@+id/password" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:inputType="textPassword" 
      android:hint="Enter your password here"/> 
     <Button 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:onClick="login" 
      android:text="Login"/> 
     <Button 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="Not a member? Register" 
      android:onClick="goToRegistration"/> 


    </LinearLayout> 

Wie kann ich debuggen/beheben.

+0

Versuchen Gewichte zu jeder Ansicht Inorder Zugabe von Überschneidungen zu überwinden. – Arshak

+0

Können Sie einen Screenshot teilen? – Shaishav

+0

füge screenshot pls –

Antwort

0

Versuchen Sie, den Benutzernamen von oben nach unten zu verschieben.

android:layout_marginTop="5dp" 

Hoffe, das wird Ihnen helfen. Versuchen

0

wie diese

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    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" 
    android:orientation="vertical" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    > 
    <TextView 
     android:padding="10dp" 
     android:id="@+id/login_error" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:visibility="invisible"/> 

    <TextView 
     android:padding="10dp" 

     android:text="dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" 
     android:id="@+id/login_message" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textStyle="bold"/> 

    <EditText 
     android:padding="10dp" 

     android:id="@+id/username" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:hint="Enter your username here"/> 
    <EditText 
     android:padding="10dp" 

     android:id="@+id/password" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="textPassword" 
     android:hint="Enter your password here"/> 
    <Button 
     android:padding="10dp" 

     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:onClick="login" 
     android:text="Login"/> 
    <Button 
     android:padding="10dp" 

     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="Not a member? Register" 
     android:onClick="goToRegistration"/> 


</LinearLayout>