Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在kenburnsview splashscreen中添加另一个文本视图_Android_Animation_Splash Screen_Android Kenburnsview - Fatal编程技术网

Android 在kenburnsview splashscreen中添加另一个文本视图

Android 在kenburnsview splashscreen中添加另一个文本视图,android,animation,splash-screen,android-kenburnsview,Android,Animation,Splash Screen,Android Kenburnsview,我想在我的appname下面添加另一个文本视图 private void setAnimation() { ObjectAnimator scaleXAnimation = ObjectAnimator.ofFloat(findViewById(R.id.welcome_text), "scaleX", 5.0F, 1.0F); scaleXAnimation.setInterpolator(new AccelerateDecelerateInterpolator());

我想在我的appname下面添加另一个文本视图

private void setAnimation() {
    ObjectAnimator scaleXAnimation = ObjectAnimator.ofFloat(findViewById(R.id.welcome_text), "scaleX", 5.0F, 1.0F);
    scaleXAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    scaleXAnimation.setDuration(1200);
    ObjectAnimator scaleYAnimation = ObjectAnimator.ofFloat(findViewById(R.id.welcome_text), "scaleY", 5.0F, 1.0F);
    scaleYAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    scaleYAnimation.setDuration(1200);
    ObjectAnimator alphaAnimation = ObjectAnimator.ofFloat(findViewById(R.id.welcome_text), "alpha", 0.0F, 1.0F);
    alphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    alphaAnimation.setDuration(1200);
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(scaleXAnimation).with(scaleYAnimation).with(alphaAnimation);
    animatorSet.setStartDelay(500);
    animatorSet.start();

    findViewById(R.id.imagelogo).setAlpha(1.0F);
    Animation anim = AnimationUtils.loadAnimation(this, R.anim.translate_top_to_center);
    findViewById(R.id.imagelogo).startAnimation(anim);
}
我试图复制代码并放置了这个

scaleXAnimation = ObjectAnimator.ofFloat(findViewById(R.id.smslogan_text), "scaleX", 5.0F, 1.0F);
    scaleXAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    scaleXAnimation.setDuration(1200);
    scaleYAnimation = ObjectAnimator.ofFloat(findViewById(R.id.smslogan_text), "scaleY", 5.0F, 1.0F);
    scaleYAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    scaleYAnimation.setDuration(1200);
    alphaAnimation = ObjectAnimator.ofFloat(findViewById(R.id.smslogan_text), "alpha", 0.0F, 1.0F);
    alphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    alphaAnimation.setDuration(1200);
    animatorSet = new AnimatorSet();
    animatorSet.play(scaleXAnimation).with(scaleYAnimation).with(alphaAnimation);
    animatorSet.setStartDelay(500);
    animatorSet.start();
但是第二个文本视图出现在第一个文本视图的顶部

这是我的activity_splash.xml代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <eventnotif.sti.com.broadcastreceiver.KenBurnsView
        android:id="@+id/ken_burns_images"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <ImageView
        android:id="@+id/imagelogo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="106dp"
        android:src="@drawable/smlogo" />

    <eventnotif.sti.com.broadcastreceiver.RobotoTextView
        android:id="@+id/welcome_text"
        style="@style/TextViewAppearance.Headline2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imagelogo"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"
        android:alpha="0.0"
        android:text="@string/app_name"
        android:textColor="@color/global_color_primary_light" />
    <eventnotif.sti.com.broadcastreceiver.RobotoTextView
        android:id="@+id/smslogan_text"
        style="@style/TextViewAppearance.Headline2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imagelogo"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"
        android:alpha="0.0"
        android:text="@string/slogan"
        android:textColor="@color/global_color_primary_light" />
</RelativeLayout>

试着在标题2中这样修改

 <eventnotif.sti.com.broadcastreceiver.RobotoTextView
        android:id="@+id/smslogan_text"
        style="@style/TextViewAppearance.Headline2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"

        <!--Set below welcome text-->

        android:layout_below="@+id/welcome_text"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"
        android:alpha="0.0"
        android:text="@string/slogan"
        android:textColor="@color/global_color_primary_light" />

可以发布您的xml代码吗?添加xml代码完成