2016-07-13 6 views

Odpowiedz

23

Zgodnie this wsparcia Android trzeba dodać te linie:

import { 
    UIManager, 
    LayoutAnimation 
} from 'react-native'; 

//.. 

UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); 
+0

Nice! Nie widziałem tego, ponieważ umieścili go pod stroną Animacje, ale nie na stronie LayoutAnimation! – nomad

+0

@nomad w prawo, zadowolony, jeśli to pomaga. Zauważ, że również musisz zaimportować 'UIManager' z' react-native', dodałem go do mojej odpowiedzi – Cherniv

2

najpierw zaimportować następujące:

import { 
    UIManager, 
    LayoutAnimation, Platform 
} from 'raect-native'; 

następnie w klasie komponentu:

constructor() { 
    super(); 
    if (Platform.OS === 'android') { 
     UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); 
    } 
} 

To jest jak to dla mnie zadziałało.

Powiązane problemy