Hi friends, This is essentially a continuation of this post http://www.coderzheaven.com/2018/08/10/how-to-create-a-custom-native-imageview-in-android-for-reactnative/ Now we will listen to a click event from the image we just created. For that we have to add the ClickListener to the image in Android. Add below methods to the java class On the React Native Side The whole java class will look like this.
Many times we need custom components from native. Here is a simple example on how to create a custom imageview in Android for react native. First we will start with the Android Version Android Create a class that extends SimpleViewManager. Write a setSrc method which accepts the source url from React Native. Implement ‘createViewInstance’ method in which you… Read More »