2016-08-13 40 views
-1

我試過android:windowSoftInputMode =「adjustResize」,但它不工作。輸入密碼後,用戶必須點擊結束,但我需要能夠看到我的登錄按鈕 - 但如何? :)當點擊edittext佈局上去

我的問題是這樣的: enter image description here

我加入到Android的表現:windowSoftInputMode = 「adjustResize」 但沒有任何變化。

我的XML代碼:

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:fitsSystemWindows="true" 
      android:descendantFocusability="beforeDescendants" 
      android:focusableInTouchMode="true"> 

    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:paddingTop="56dp" 
     android:paddingLeft="24dp" 
     android:paddingRight="24dp" 
     android:id="@+id/touchInterceptor"> 

     <ImageView 
      android:layout_width="133dp" 
      android:layout_height="137dp" 
      android:id="@+id/imageView" 
      android:layout_gravity="center_horizontal" 
      android:background="@drawable/elma_logo4" 
      android:layout_weight="2.00" /> 
     <!-- Email Label --> 
     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="8dp" 
      android:layout_marginBottom="8dp"> 
      <EditText android:id="@+id/input_email" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:inputType="textEmailAddress" 
       android:hint="Email" 
         android:focusable="false"/> 
     </android.support.design.widget.TextInputLayout> 

     <!-- Password Label --> 
     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="8dp" 
      android:layout_marginBottom="8dp"> 
      <EditText android:id="@+id/input_password" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:inputType="textPassword" 
       android:hint="@string/ifre" 
         android:focusable="false"/> 
     </android.support.design.widget.TextInputLayout> 


     <CheckBox 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Şifremi Hatırla" 
      android:id="@+id/cb_Hatirla" 
      android:layout_weight="2.00"/> 

     <android.support.v7.widget.AppCompatButton 
      android:id="@+id/btn_login" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="24dp" 
      android:layout_marginBottom="24dp" 
      android:padding="0dp" 
      android:text="Giriş"/> 

     <ProgressBar 
      style="?android:attr/progressBarStyleSmall" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/progressBar" 
      android:layout_gravity="center_horizontal" /> 


     <TextView android:id="@+id/link_forgotpass" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginBottom="24dp" 
        android:text="Şifremi Unuttum?" 
        android:gravity="center" 
        android:textSize="16dip"/> 

     <TextView android:id="@+id/link_signup" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginBottom="24dp" 
      android:text="Hesabınız yok mu ? Hemen Oluşturun!" 
      android:gravity="center" 
      android:textSize="16dip"/> 



    </LinearLayout> 
</ScrollView> 
+0

你的問題是完全無法理解.. –

+0

我的意思是,當我點擊密碼的EditText我希望看到我的登錄按鈕 –

+0

我想你需要在用戶輸入密碼後管理'actionDone'。它會自動隱藏鍵盤,你可以看到你的登錄按鈕。 – pRaNaY

回答

3

android:imeOptions="actionNext"input_email的EditText。這可以幫助您在鍵盤上顯示next按鈕以導航input_password

並把android:imeOptions="actionDone"改爲input_password EditText,它可以幫助你在鍵盤上顯示Done按鈕。 當點擊Done按鈕,你可以看到你btn_login

這是在EditText中導航用戶的正確方法。

查看Specifying the Input Method Type的EditText。

我希望它能幫助你。

0

用它在你的manifies文件 機器人:windowSoftInputMode =「stateHidden | adjustResize | stateAlwaysHidden」 >