我希望“启动”屏幕后出现“布局”身份验证,在我的应用程序中默认显示,请有人帮我!!!!!
请我需要帮助

public class Splash extends Activity {
        LinearLayout ln;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.splashh);

    ln = (LinearLayout) findViewById(R.id.LinLaySpalScrenLogin);



            final ImageView iv = (ImageView) findViewById(R.id.imageView);
            final Animation an = AnimationUtils.loadAnimation(getBaseContext(),R.anim.rotate);
            final Animation an2 = AnimationUtils.loadAnimation(getBaseContext(),R.anim.abc_fade_out);

            iv.startAnimation(an);
            an.setAnimationListener(new Animation.AnimationListener() {
                @Override
                public void onAnimationStart(Animation animation) {

                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    iv.startAnimation(an2);
                    finish();

    ln.setVisibility(View.VISIBLE);

                }

                @Override
                public void onAnimationRepeat(Animation animation) {

                }
            });
        }
    }

最佳答案

您可以在包含启动画面的LinearLayout xml文件中设置android:visibility="gone",然后在完成动画后调用yourlayout.setVisibility(View.VISIBLE);
另外,动画结束后,您的活动就会结束,因为您在finish()之前调用了ln.setVisibility(View.VISIBLE);尝试删除finish(),并且仅在某些事件(例如按钮单击或类似事件)中调用它

关于java - 开机画面后出现文字,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36636778/

10-11 00:05