I came across a rather interesting but annoying mistake, in my linear layout I hid another linear layout using margin in the negative, and when the user selects a type from the list, I bring the layout to the front using Translational Animation, the error is that the layout comes to the fore, the edit text becomes dead, and when I scroll (my main layout is surrounded by scrolling), it comes to life, and when I stop scrolling, it becomes dead again ... I really did not understand why this happens, so guys pl z help ....
I also inserted a link to the video below, showing this annoying behavior of my application.
http://www.dailymotion.com/video/xlskk8_android-app-edit-text-error_tech
my xml layout inside scroll view
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:layout_marginTop="-110dip" android:layout_marginBottom="5dip" android:id="@+id/notes_editor" android:orientation="vertical" > <EditText android:id="@+id/enter_note" android:layout_height="wrap_content" android:layout_width="fill_parent" android:maxLines="2" android:lines="2"> </EditText> <Button android:id="@+id/save_note" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Save" /> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="-10dip" android:id="@+id/notes_list" android:orientation="vertical" > </LinearLayout> </LinearLayout>
the empty linear layout below the button is used to dynamically add child views, all other things perform their functionality properly, only the editing text shows this abnormal behavior.
animation code below
public void animateEditor() { slider = new TranslateAnimation(0, 0, 0,180 ); slider.setDuration(1250); slider.setFillAfter(true); notes_list.startAnimation(slider); notes_editor.startAnimation(slider); }
android android-edittext
Umar qureshi
source share