0

I'm working on a react native android application. My IDE is android studio and I'm using android studio emulator.

When I try to load local background image to my application page, the image loads very slow and all application process also works slow.

I saw some post about this issue but could not find a proper solution.

I didn't understand the relation between the image and the other events.

For example, when I press a simple button, detection of the press action takes seconds if the image has set.

Sample code:

    ...
    onPress1(){
          alert('onPress..');
        }
        render(){
           return(){
             <View>
               <View style={ somestyle }>
                 <Image source={require('./img/background.jpg')} />
               </View>
               <View style={ somestyle }>
                   <View style= {somestyle}>
                       <TouchableHighlight style={ somestyle } onPress={() => this.onPress1()}>
                           <Text style={ somestyle }>Btn 1</Text>
                       </TouchableHighlight>
                   </View>
               </View>
             </View>
           }
        }
    ...

Any suggestion ? Thank you very much.

kbrk
  • 610
  • 1
  • 9
  • 27
  • I switched to Genymotion because I found the stock Android emulators dreadfully slow. Also, try turning dev mode off and see if it's still a bad experience? – jsplaine Sep 19 '16 at 19:40
  • Hi, @jsplaine Yes you are right about the emulator but I think the main problem is not about the emulator because after image tag set everything is surprisingly slow. – kbrk Sep 23 '16 at 12:54
  • 1
    I tried http://stackoverflow.com/questions/29322973/whats-the-best-way-to-add-a-full-screen-background-image-in-react-native/32428956#32428956 and http://stackoverflow.com/questions/29322973/whats-the-best-way-to-add-a-full-screen-background-image-in-react-native/33242147#33242147 with different versions of nodejs and npm (the last and the others) in Windows 10 and again it was slow. However I tried in Windows 7 and in my mobile device everything works normal. The only difference is operating system I think. – kbrk Sep 23 '16 at 12:56
  • Wow, windows 10 ugh ... that stinks. – Squeaky Sep 23 '16 at 18:04

0 Answers0