我一直在努力使两个片段之间的过渡生动起来。我最初在xml中放置了一个属性动画(但这并不有效),然后将其更改为objectAnimator。出于某种原因,Android没有识别objectAnimator标记。
这是我的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>我的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.+"
}以及xml文件:
<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android">
</objectAnimator>谢谢你花时间看这个。我不知道该怎么办了。
发布于 2015-06-19 02:27:16
我认为您把xml文件放错了文件夹。
valueAnimator objectAnimator和animatorSet资源应该在res/漫画家文件夹中,而不是在res/anim中。
有关更多信息,请访问android开发者。http://developer.android.com/guide/topics/resources/animation-resource.html
https://stackoverflow.com/questions/25128928
复制相似问题