2014-01-28 5 views
0

У меня есть ScrollView с некоторыми виджетами в нем, среди них EditText. Когда я пишу пару строк в EditText (id:message), я не могу прокрутить ScrollView до конца, он застрял, пока я не закрою мягкую клавиатуру. После этого, если я снова войду в EditText и напишу еще пару строк, этого больше не произойдет. Это происходит только на Android 4.x, а не на 2.3. Как я могу предотвратить застревание моего ScrollView?ScrollView застрял, когда клавиатура открыта и курсор в EditText

Вот мой макет:

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

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:paddingLeft="8dp" 
     android:paddingRight="8dp" > 

     <EditText 
      android:id="@+id/name" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="@string/ihr_name" 
      android:imeOptions="flagNoExtractUi" 
      android:inputType="textPersonName" 
      android:singleLine="true" > 
     </EditText> 

     <EditText 
      android:id="@+id/email" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="4dp" 
      android:hint="@string/ihre_email" 
      android:imeOptions="flagNoExtractUi" 
      android:inputType="textEmailAddress" 
      android:singleLine="true" /> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="4dp" > 

      <asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton 
       android:id="@+id/startDate" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" /> 

      <TextView 
       android:id="@+id/starterror" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:layout_marginRight="16dp" 
       android:background="#00000000" /> 
     </RelativeLayout> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="4dp" > 

      <asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton 
       android:id="@+id/endDate" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" /> 

      <TextView 
       android:id="@+id/enderror" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:layout_marginRight="16dp" 
       android:background="#00000000" /> 
     </RelativeLayout> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="4dp" > 

      <asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton 
       android:id="@+id/xy" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" /> 

      <TextView 
       android:id="@+id/adulterror" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:layout_marginRight="16dp" 
       android:background="#00000000" /> 
     </RelativeLayout> 

     <asco.asco.spinnerbuttonlib.spinnerbutton.StaticSpinnerbutton 
      android:id="@+id/tre" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="4dp" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="4dp" 
      android:layout_marginTop="24dp" 
      android:text="Message: " 
      android:textAppearance="@style/StandardTextBold" 
      android:textColor="@color/myorange" /> 

     <EditText 
      android:id="@+id/message" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="4dp" 
      android:hint="@string/ihre_nachricht" 
      android:inputType="textNoSuggestions|textMultiLine" 
      android:text="@string/contact_message" /> 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="16dp" 
      android:text="@string/pflichtfelder" 
      android:textAppearance="@style/SmallText" /> 

     <Button 
      android:id="@+id/send" 
      style="@style/ButtonTheme" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="16dp" 
      android:text="Senden" /> 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="16dp" 
      android:text="@string/contact_datenschutz" 
      android:textAppearance="@style/SmallText" /> 
    </LinearLayout> 

</ScrollView> 

Вот скриншот прилипшей макета (не слишком интересно, наверное):

enter image description here

ответ

0

Ваши варианты ввода установлены для панорамирования (сохранить вид мы вводятся видимыми)

добавить android:windowSoftInputMode="adjustResize" к вашему заявлению о деятельности в манифесте

Смежные вопросы