키보드가 나타나지 않지만 내 특정 문제와 관련된 질문/해결책이 여기에 있습니다. EditText를 클릭하면 키보드가 잘 나타납니다. 하지만 EditText를 먼저 움직이면 EditText를 클릭하면 키보드가 나타나지 않습니다.안드로이드 - 애니메이션이 발생한 후에 키보드가 edittext에 나타나지 않습니다.
왜 이런 일이 일어날 수 있으리라 생각하십니까?
내 액티비티에서는 먼저 내 로고에 애니메이션을 적용하고 애니메이션이 끝나면 EditText에 대한 페이드 인 애니메이션을 만듭니다. 애니메이션을 끝내고 나면 아무거나 클릭해도 키보드가 나타나지 않습니다.
여기 내 활동 내에서 onCreate 방법 :
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE); //Remove title bar
setContentView(R.layout.login);
final EditText emailField = (EditText) findViewById(R.id.emailField);
final EditText passwordField = (EditText) findViewById(R.id.passwordField);
final TextView logInText = (TextView) findViewById(R.id.logInText);
final Button signupButton = (Button) findViewById(R.id.signupButton);
final Button loginButton = (Button) findViewById(R.id.loginButton);
//animation of logo
ImageView img_animation = (ImageView) findViewById(R.id.encoreLogo);
TranslateAnimation animation = new TranslateAnimation(0.0f, 00f,
0.0f, -400.0f);
animation.setDuration(4000);
animation.setFillAfter(true);
animation.setStartOffset(2000);
img_animation.startAnimation(animation);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
Animation animFadeIn = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.fade_in);
animFadeIn.setDuration(2000);
animFadeIn.setFillAfter(true);
emailField.setAnimation(animFadeIn);
passwordField.setAnimation(animFadeIn);
logInText.setAnimation(animFadeIn);
loginButton.setAnimation(animFadeIn);
signupButton.setAnimation(animFadeIn);
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) {}
});
signupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent myIntent = new Intent(MainActivity.this, SignUpActivity.class);
MainActivity.this.startActivity(myIntent);
}
});
}
여기 내 해당 login.xml입니다 : 사전에
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/backroundImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:cropToPadding="false"
android:scaleType="centerCrop"
android:src="@drawable/crowdblur1" />
<ImageView
android:id="@+id/encoreLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:adjustViewBounds="true"
android:maxHeight="@dimen/thumbnail_height"
android:maxWidth="@dimen/thumbnail_width"
android:scaleType="centerInside"
android:src="@drawable/hand72" />
<TextView
android:id="@+id/logInText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/encoreLogo"
android:layout_alignLeft="@+id/passwordField"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:layout_marginBottom="79dp"
android:paddingLeft="@dimen/left_padding_login_text"
android:text="Login to Encore"
android:textColor="@android:color/white"
android:textSize="@dimen/log_in_text"
android:textStyle="bold"
android:visibility="invisible" />
<EditText
android:id="@+id/emailField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/encoreLogo"
android:layout_centerHorizontal="true"
android:layout_marginBottom="18dp"
android:background="@drawable/rounded_corners"
android:ems="10"
android:inputType="textEmailAddress"
android:hint="Email"
android:textColor="@android:color/black"
android:textStyle="italic"
android:visibility="invisible" />
<EditText
android:id="@+id/passwordField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/encoreLogo"
android:layout_centerHorizontal="true"
android:background="@drawable/rounded_corners"
android:ems="10"
android:inputType="textPassword"
android:hint="Password"
android:textStyle="italic"
android:textColor="@android:color/black"
android:visibility="invisible" />
<Button
android:id="@+id/signupButton"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/loginButton"
android:layout_centerHorizontal="true"
android:layout_marginTop="22dp"
android:background="@android:color/transparent"
android:text="@string/signUp"
android:textColor="#5FC2FF"
android:textSize="@dimen/signupText"
android:textStyle="bold"
android:visibility="invisible" />
<Button
android:id="@+id/loginButton"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/passwordField"
android:layout_centerHorizontal="true"
android:layout_marginTop="14dp"
android:background="@android:color/transparent"
android:text="@string/login"
android:textColor="@android:color/white"
android:textSize="@dimen/signupText"
android:visibility="invisible" />
감사합니다!