2016-07-13 35 views

risposta

23

Come per this per il supporto Android è necessario aggiungere queste righe:

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

//.. 

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

Bello! Non l'ho visto perché lo hanno messo nella pagina Animazioni ma non nella pagina LayoutAnimation! – nomad

+0

@nomad right, felice se aiuta. Si noti inoltre che è necessario importare 'UIManager' da' react-native', l'ho aggiunto alla mia risposta – Cherniv

2

Prima importare i seguenti:

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

poi nella classe del componente:

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

questo è come ha funzionato per me

Problemi correlati