2013-07-05 10 views
5

Mam następujący układwindowSoftInputMode ustawiony stateHidden | adjustResize nie działa w Androidzie

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:layout_gravity="bottom" 
android:background="@drawable/background_grey" 
android:fillViewport="true" 
android:focusable="true" 
android:focusableInTouchMode="true" 
android:orientation="vertical" > 

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <RelativeLayout 
     android:id="@+id/logo_layout" 
     android:layout_width="fill_parent" 
     android:layout_height="@dimen/layout_height" 
     android:layout_alignParentTop="true" 
     android:background="@drawable/logo_container" > 

     <!-- some layout components--> 
    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/logo_layout" 
     android:layout_margin="@dimen/default_margin" > 

        <!-- some layout components--> 

     <RelativeLayout 
      android:id="@+id/activation_code_entry_layout" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/activation_body_second_paragraph" 
      android:layout_centerHorizontal="true" 
      android:layout_marginTop="20dp" 
      android:background="@drawable/enter_passcode_background" 
      android:gravity="center_vertical" > 

         <!-- some layout components--> 

      <EditText 
       android:id="@+id/activationCode" 
       style="@style/FormField" 
       android:layout_alignParentRight="true" 
       android:layout_marginRight="@dimen/side_margin" 
       android:hint="@string/activation_enter_code" 
       android:inputType="number" 
       android:maxLength="10"/> 

         <!-- some layout components--> 
     </RelativeLayout> 

        <!-- some layout components--> 
    </RelativeLayout> 
</RelativeLayout> 

</ScrollView> 

w pliku manifestu aplikacji mam ustawienie aktywność jako

<activity 
     android:name=".activities.MyActivity" 
     android:enabled="true" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" 
     android:theme="@android:style/Theme.NoTitleBar" 
     android:windowSoftInputMode="stateHidden|adjustResize" > 
    </activity> 

ale widok nie przewijać w górę po pojawieniu się klawiatury programowej.

+0

Było to jedyne rozwiązanie działa dla mnie: http://stackoverflow.com/a/30019136/832008 – Analizer

Odpowiedz

2

Udało mi się naprawić mój problem. Oto jest.

I zmodyfikowane pierwszego dziecka głównego widoku przewijania w następujący sposób

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="bottom" > 

to, że dodaje się

android:layout_gravity="bottom" 

to od układu zawsze wykazują dno jak waga była dołu.

Mam nadzieję, że to pomoże innym

Cheers

+0

Prawie czego potrzebowałem. Postawiłem moje na "wypełnij" – Vas

Powiązane problemy