如何修改React-Native textInput组件?

时间:2021-08-23 18:58:27

React-native offers developing native modules and UI components in its official site.

React-native在其官方站点中提供开发本机模块和UI组件。

However I want to make minor changes in the TextInput component which is used in my app and is found on my computer. However there is no a Java file that is related with TextInput.

但是,我想在我的应用程序中使用的TextInput组件中进行细微更改,并在我的计算机上找到。但是,没有与TextInput相关的Java文件。

Is there any way to make small changes in TextInput in my app?

有没有办法在我的应用程序中对TextInput进行小的更改?

2 个解决方案

#1


0  

In order to apply changes to React Native android source and have them in the app, you have to compile it from source.

为了将更改应用于React Native android源并将它们放在应用程序中,您必须从源代码编译它。

You can follow the official guide: https://facebook.github.io/react-native/docs/android-building-from-source.html#content

您可以按照官方指南进行操作:https://facebook.github.io/react-native/docs/android-building-from-source.html#content

#2


0  

Since RN v0.21.0

自RN v0.21.0起

The distribution of Android files have changed and is now done with npm.

Android文件的分发已经改变,现在用npm完成。

The files can be found under node_modules/react-native/android/com/facebook/react/react-native/0.21.0/in a the archive react-native-0.21.0-sources.jar

这些文件可以在archive_modules / react-native / android / com / facebook / react / react-native / 0.21.0 /下的archive-native-0.21.0-sources.jar中找到。

They can't be changed just like this, thought you can have a look at this

它们不能像这样改变,以为你可以看看这个

Edit : Works with RN 0.20.0 or lower

编辑:适用于RN 0.20.0或更低版本

I guess what you're looking for is this file

我想你要找的是这个文件

You can modify it in your react-native folder under node_modules :

您可以在node_modules下的react-native文件夹中修改它:

node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/

#1


0  

In order to apply changes to React Native android source and have them in the app, you have to compile it from source.

为了将更改应用于React Native android源并将它们放在应用程序中,您必须从源代码编译它。

You can follow the official guide: https://facebook.github.io/react-native/docs/android-building-from-source.html#content

您可以按照官方指南进行操作:https://facebook.github.io/react-native/docs/android-building-from-source.html#content

#2


0  

Since RN v0.21.0

自RN v0.21.0起

The distribution of Android files have changed and is now done with npm.

Android文件的分发已经改变,现在用npm完成。

The files can be found under node_modules/react-native/android/com/facebook/react/react-native/0.21.0/in a the archive react-native-0.21.0-sources.jar

这些文件可以在archive_modules / react-native / android / com / facebook / react / react-native / 0.21.0 /下的archive-native-0.21.0-sources.jar中找到。

They can't be changed just like this, thought you can have a look at this

它们不能像这样改变,以为你可以看看这个

Edit : Works with RN 0.20.0 or lower

编辑:适用于RN 0.20.0或更低版本

I guess what you're looking for is this file

我想你要找的是这个文件

You can modify it in your react-native folder under node_modules :

您可以在node_modules下的react-native文件夹中修改它:

node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/