2012-01-13 5 views
1

Я никогда раньше этого не видел. У меня есть простой пользовательский вид с анимированным фоном, и помимо этого представления я реализовал стандартный вид Android. TextViews, EditTexts, ImageViews и т. Д.Android Soft Keyboard Distorts Views При закрытии

Когда мягкая клавиатура вставлена, и я вхожу в информацию, все работает нормально. Когда клавиатура скрыта, просмотры становятся беспорядочными. Кто-нибудь видел это раньше? Это происходит на Galaxy Nexus S, и весь код является стандартной реализацией. Какие-либо настройки или что-то мне не хватает? Я пробовал View.invalidate без везения. Единственный способ решить проблему - перезагрузить представление, которое я нахожу довольно раздражающим!

Вот код для View I call, «Enroll».

<?xml version="1.0" encoding="utf-8"?> 

<!-- Intended for logging in or creating an account --> 

<ImageView 
    android:id="@+id/fillininfo" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:scaleType="centerInside" 
    android:background="@null" 
    android:src="@drawable/friends_enroll_fillininfo" 
/> 

<ImageView 
    android:id="@+id/name" 
    android:layout_below="@id/fillininfo" 
    android:layout_width="wrap_content" 
    android:layout_height="20dip" 
    android:scaleType="centerInside" 
    android:layout_centerHorizontal="true" 
    android:background="@null" 
    android:src="@drawable/name" 
/> 

<EditText 
    android:id="@+id/friends_enroll_name" 
    android:layout_marginLeft="5dip" 
    android:layout_marginRight="5dip" 
    android:layout_width="fill_parent" 
    android:layout_height="30dip" 
    android:layout_below="@id/name" 
    android:hint="A name you go by..." 
    android:inputType="textPersonName|textCapWords" 
    android:gravity="center" 
    android:textSize="16sp" 
    android:maxLines="1" 
    android:lines="1" 
    android:singleLine="true" 
    android:textColor="@color/white" 
    android:textColorHighlight="@color/white" 
    android:textColorHint="@color/white" 
    android:textColorLink="@color/white" 
    android:background="@drawable/textbox_background" 

/> 

<ImageView 
    android:id="@+id/email" 
    android:layout_below="@id/friends_enroll_name" 
    android:layout_width="wrap_content" 
    android:layout_height="20dip" 
    android:scaleType="centerInside" 
    android:layout_centerHorizontal="true" 
    android:background="@null" 
    android:src="@drawable/email" 
/> 

<EditText 
    android:id="@+id/friends_enroll_email" 
    android:layout_marginLeft="5dip" 
    android:layout_marginRight="5dip" 
    android:layout_width="fill_parent" 
    android:layout_height="30dip" 
    android:layout_below="@id/email" 
    android:hint="Your email address..." 
    android:inputType="textEmailAddress" 
    android:gravity="center" 
    android:textSize="16sp" 
    android:maxLines="1" 
    android:lines="1" 
    android:singleLine="true" 
    android:textColor="@color/white" 
    android:textColorHighlight="@color/white" 
    android:textColorHint="@color/white" 
    android:textColorLink="@color/white" 
    android:background="@drawable/textbox_background" 
/> 

<RelativeLayout 
    android:id="@+id/subscribed" 
    android:layout_below="@id/friends_enroll_email" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_marginLeft="5dip" 
    android:layout_marginRight="5dip" 
    android:layout_marginTop="5dip" 
    android:background="@null" 
> 
    <TextView 
     android:id="@+id/subscribed_text" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textSize="16sp" 
     android:background="@null" 
     android:layout_centerVertical="true" 
     android:text="Email updates and product offers" 
    /> 

    <CheckBox 
     android:id="@+id/friends_enroll_issubscribed" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="5dip" 
     android:layout_toRightOf="@id/subscribed_text" 
     android:checked="true" 
     android:text=" " 
    /> 

</RelativeLayout> 

<ImageButton 
    android:id="@+id/send_confirmation" 
    android:layout_width="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_height="40dip" 
    android:layout_below="@id/subscribed" 
    android:scaleType="centerInside" 
    android:src="@drawable/button_send_confirmation" 
    android:background="@null" 
/> 

<TextView 
    android:id="@+id/friends_enroll_msg" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/send_confirmation" 
    android:textColor="@color/white" 
    android:text="" 
    android:singleLine="false" 
    android:gravity="center" 
    android:textSize="14sp" 
/> 

Views distorted after soft keyboard is minimized - android

С уважением,

Bob

ответ

0

Я ответил, установив андроид: imeOptions в XML моего макета для «actionDone».

Мягкая клавиатура предполагала «actionNext», в результате чего вид сдвигался вверх, искажая вид. С указанным «actionDone» представление больше не принимает другого EditText.

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