Ich habe die Anzahl der Edit-Texte in der Layout-Datei, die Soft-Tastatur deckt einige der Texte bearbeiten. Ich möchte ganze Edit-Texte nach oben scrollen, wenn der Benutzer auf den ersten Text klickt, damit alle Felder gleichzeitig sichtbar sind. Ich habe versucht, ScroolView, isScrollContainer, Ausrichtung: vertikal, requestFocus, android: imeOptions = "flagNoFullscreen" in XML-Datei und Android: windowSoftInputMode = "adjustPan | adjustResize" in Manifest hinzugefügt. Aber nicht die erwarteten Ergebnisse. hier ist meine XML-DateiSoft-Tastatur abdecken EditText Felder android
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:background="@drawable/register_back"
tools:context="com.example.RegisterActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/registerFieldsRL"
android:layout_marginTop="40dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/header"
android:text="Register"
android:textAllCaps="true"
android:textColor="#646b99"
android:textSize="18dp"
android:gravity="center"
android:layout_centerHorizontal="true" />
<EditText
android:id="@+id/nameET"
android:hint="Enter Your Name"
android:layout_below="@+id/header"
style="@style/editTextStyle"
android:layout_marginTop="10dp"
android:singleLine="true"/>
<EditText
android:id="@+id/emailET"
android:hint="Enter Your Email Id"
android:layout_below="@+id/nameET"
style="@style/editTextStyle"
android:layout_marginTop="5dp"
android:singleLine="true"/>
<EditText
android:id="@+id/mobileET"
android:hint="Enter Your Mobile Number"
android:layout_below="@+id/emailET"
style="@style/editTextStyle"
android:layout_marginTop="5dp"
android:singleLine="true"/>
<EditText
android:id="@+id/passwordET"
android:hint="Enter Password"
android:layout_below="@+id/mobileET"
style="@style/editTextStyle"
android:layout_marginTop="5dp"
android:singleLine="true"/>
<EditText
android:id="@+id/confrm_passwordET"
android:hint="Re-enter Password"
android:layout_below="@+id/passwordET"
style="@style/editTextStyle"
android:layout_marginTop="5dp"
android:singleLine="true"/>
<Button
android:layout_width="200dp"
android:layout_height="40dp"
android:id="@+id/logon_button"
android:text="Logon"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_below="@+id/confrm_passwordET"
android:layout_marginTop="7dp"
android:background="#db96a3"
android:textColor="#e8d3c1"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/social_loginsRL"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/social_login_header"
android:text="- OR LOGIN WITH -"
android:layout_centerHorizontal="true"
android:textColor="#646b99"
android:textSize="18dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="@+id/social_login_header"
android:layout_marginTop="10dp">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/facebook_button"
android:background="@drawable/fbbutton"
android:layout_toLeftOf="@+id/social_login_split_view"/>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:id="@+id/social_login_split_view"></View>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/gmail_button"
android:background="@drawable/gmailbutton"
android:layout_toRightOf="@+id/social_login_split_view" />
</RelativeLayout>
</RelativeLayout>
und hier ist mein Style code
<style name="editTextStyle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:background">@drawable/edittext_background</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:backgroundTint">#e8d3c1</item>
<item name="android:textColor">#646b99</item>
</style>
und das ist mein Drawable Datei
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/patient_details_et_background"/>
<item>
<shape>
<stroke
android:width="1dp"
android:color="#d4c6c1" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
Wenn Sie 'Scroll View' verwendet haben, sollte es praktikabel sein. Was ist das Problem bei der Verwendung? –
googlebutton und facebook button decken den Rest des edittext ab, nur zwei edittext Felder sind sichtbar. – Tara
Also sind alle Ihre 5 'Texte bearbeiten 'nicht scrollbar? –