【发布时间】:2014-09-27 12:45:41
【问题描述】:
我一直在尝试为两个片段之间的过渡设置动画。我最初在 xml 中放置了一个属性动画(这并没有真正起作用),然后将其更改为 objectAnimator。由于某种原因,Android Studio 无法识别 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>
感谢您抽出宝贵时间查看此内容。我不知道该怎么办了。
【问题讨论】:
-
面临同样的问题...任何答案?
-
什么对我有用:(注意:目前在 Android Studio 中工作): 1. 在 res 文件夹中创建 anim 文件夹。 2. 右键单击动画文件夹并添加动画资源文件。 3.将根元素输入为objectAnimator(即使它没有出现在自动完成建议中)。还有多田!
标签: android xml android-fragments android-studio objectanimator