Android Studio XML does not recognize objectAnimator

I am trying to animate the transition between two fragments. I initially posted their property animation in xml (and it really didn't work) and then changed it to objectAnimator. For some reason, Android Studio does not recognize the objectAnimator tag.

here is my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.nick.randomapplication" > <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Base.AppCompat.Light" > <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> 

my build.Gradle:

 apply plugin: 'com.android.application' android { compileSdkVersion 20 buildToolsVersion "20.0.0" defaultConfig { applicationId "com.example.nick.randomapplication" minSdkVersion 19 targetSdkVersion 20 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile "com.android.support:appcompat-v7:20.0.+" } 

and xml file:

 <?xml version="1.0" encoding="utf-8"?> <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"> </objectAnimator> 

Thanks for taking the time to look at this. I'm not sure what to do next.

+7
android xml android-studio android-fragments objectanimator
source share
1 answer

I think you put the xml in the wrong fold.

The resource for [value animator \ object animator \ animator set] must be in the res / bend animator. not res / anim

please visit the android development center to find the reason: http://developer.android.com/guide/topics/resources/animation-resource.html

+22
source share

All Articles