我正在使用lottie本机反应本机。我刚安装了它,npm并使用react native链接将其链接起来,但是当我尝试构建它时,我在lottie的类错误中得到了一个错误:
package android.support.v4.view does not exist
这些是我对应用程序gradle的依赖
dependencies {
compile project(':lottie-react-native')
compile project(':react-native-vector-icons')
compile project(':react-native-view-overflow')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.facebook.react:react-native:+'
// From node_modules
implementation "android.arch.work:work-runtime:$versions.work"
implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex:rxandroid:1.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
transitive = true;
}
implementation 'com.android.support:support-v4:28.0.3'
implementation 'com.android.support:appcompat-v7:28.0.3'
}
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.pois"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
} …Run Code Online (Sandbox Code Playgroud) android android-appcompat android-support-library react-native lottie
我对 React Native 中的动画 API 相当陌生。我浏览了很多使用动画 API 的教程,似乎每个教程中的元素都是绝对定位的,是否有必要将元素绝对定位?
我还制作了一段动画,但它看起来有问题,我认为文本输入后的视图没有绝对位置,这可能会导致问题。是否可以在保持文本输入位置绝对但其他元素使用 Flexbox 定位的同时执行我尝试的动画?
这是代码
handleFocus = () => {
console.log('starting animation');
this.setState({
isFocused: true
});
Animated.timing(this.isFromViewFocused, {
toValue: 1,
duration: 300
}).start();
}
handleBlur = () => {
console.log('Blurring');
this.setState({
isFocused: false
});
Animated.timing(this.isFromViewFocused, {
toValue: 0,
duration: 300
}).start();
}
render() {
const labelStyle = {
position: this.state.isFocused === true ? 'absolute' : 'relative',
alignItems: 'center',
width: this.isFromViewFocused.interpolate({
inputRange: [0, 1],
outputRange: [DEVICE_WIDTH * 0.45, DEVICE_WIDTH]
}),
left: this.isFromViewFocused.interpolate({
inputRange: [0, …Run Code Online (Sandbox Code Playgroud)