- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
已解决!阅读我的回答。
我正在尝试在 native React 应用程序中显示 Unity View 。此 UnityPlayer 使用 Vuforia 显示 AR 的相机源。我们需要将此 View 包含在适用于 iOS 和 Android 的 React-native 应用程序中。
我遵循了很多指南,但在 Android 版本中出现黑屏。如果我在 react-native(而不是 ReactActivity)生成的 Android 项目中运行 UnityPlayerActivity(从 Unity 导出的 Android 项目),我会正确地看到我的 UnityPlayer。所以我想我的项目包含所有必要的依赖项。
我的 js 代码 fragment :
const UnityIosContainerView = requireNativeComponent("UnityContainerView",
null);
const UnityAndroidContainerView = requireNativeComponent("RCT3DView", null);
class ArPage extends React.Component {
render() {
return (
<View style={{ flex: 1, backgroundColor: "red" }}>
{Platform.OS === "ios" ? (
<UnityIosContainerView style={{ flex: 1 }} />
) : (
<UnityAndroidContainerView style={{ flex: 1 }} />
)}
</View>
);
}
}
遵循本指南 https://facebook.github.io/react-native/docs/native-components-android.html我有一个自定义包
public class CustomReactPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Arrays.<ViewManager>asList(
new React3DViewManager()
);
}
}
这是我的 ViewManager 连接到 MainReactActivity 的生命周期以正确管理 UnityPlayer
public class React3DViewManager extends SimpleViewManager<View> implements LifecycleEventListener {
public static final String REACT_CLASS = "RCT3DView";
private UnityPlayer mUnityPlayer;
@Override
public String getName() {
return REACT_CLASS;
}
@Override
protected View createViewInstance(ThemedReactContext reactContext) {
reactContext.addLifecycleEventListener(this);
mUnityPlayer = new UnityPlayer(reactContext);
int glesMode = mUnityPlayer.getSettings().getInt("gles_mode", 1);
boolean trueColor8888 = false;
mUnityPlayer.init(glesMode, trueColor8888);
mUnityPlayer.start();
mUnityPlayer.requestFocus();
return mUnityPlayer.getView();
}
@Override
public void onHostResume() {
mUnityPlayer.resume();
}
@Override
public void onHostPause() {
mUnityPlayer.pause();
}
@Override
public void onHostDestroy() {
mUnityPlayer.quit();
}
}
生成的屏幕截图:
验证点:
统一 2017.2.0f3
react 16.0.0.0-alpha12
React-native 0.48.4
有人遇到过这个问题吗?
应用日志:
01-05 13:39:27.142 7233-7240/? I/art: Starting a blocking GC Instrumentation
01-05 13:39:27.156 7233-7233/? W/ActivityThread: Application com.protoreactnative is waiting for the debugger on port 8100...
01-05 13:39:27.156 7233-7233/? I/System.out: Sending WAIT chunk
01-05 13:39:29.228 7233-7240/com.protoreactnative I/art: Debugger is active
01-05 13:39:29.365 7233-7233/com.protoreactnative I/System.out: Debugger has connected
01-05 13:39:29.365 7233-7233/com.protoreactnative I/System.out: waiting for debugger to settle...
01-05 13:39:29.567 7233-7233/com.protoreactnative I/System.out: waiting for debugger to settle...
01-05 13:39:29.768 7233-7233/com.protoreactnative I/System.out: waiting for debugger to settle...
01-05 13:39:29.970 7233-7233/com.protoreactnative I/System.out: waiting for debugger to settle...
01-05 13:39:30.171 7233-7233/com.protoreactnative I/System.out: waiting for debugger to settle...
01-05 13:39:30.372 7233-7233/com.protoreactnative I/System.out: waiting for debugger to settle...
01-05 13:39:30.573 7233-7233/com.protoreactnative I/System.out: waiting for debugger to settle...
01-05 13:39:30.775 7233-7233/com.protoreactnative I/System.out: debugger has settled (1451)
01-05 13:39:31.131 7233-7233/com.protoreactnative I/InstantRun: starting instant run server: is main process
01-05 13:39:31.142 7233-7233/com.protoreactnative V/fb-UnpackingSoSource: locked dso store /data/user/0/com.protoreactnative/lib-main
01-05 13:39:31.143 7233-7233/com.protoreactnative I/fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.protoreactnative/lib-main
01-05 13:39:31.143 7233-7233/com.protoreactnative V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.protoreactnative/lib-main
01-05 13:39:31.217 7233-7240/com.protoreactnative I/art: Starting a blocking GC Instrumentation
01-05 13:39:31.222 7233-7233/com.protoreactnative D/ReactNative: ReactInstanceManager.ctor()
01-05 13:39:31.272 7233-7233/com.protoreactnative D/NetworkSecurityConfig: No Network Security Config specified, using platform default
01-05 13:39:31.292 7233-7233/com.protoreactnative I/SensorManager: registerListenerImpl: listener = com.facebook.react.common.ShakeDetector@f6f1ff2, sensor = {Sensor name="Accelerometer Sensor", vendor="hTC Corp.", version=1, type=1, maxRange=39.2266, resolution=0.01, power=0.17, minDelay=10000}, delay = 66667, handler = null
01-05 13:39:31.315 7233-7233/com.protoreactnative D/ReactNative: ReactInstanceManager.createReactContextInBackground()
01-05 13:39:31.316 7233-7233/com.protoreactnative D/ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
01-05 13:39:31.318 7233-7233/com.protoreactnative D/ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
01-05 13:39:31.321 7233-7233/com.protoreactnative D/ReactNative: ReactInstanceManager.recreateReactContextInBackground()
01-05 13:39:31.321 7233-7233/com.protoreactnative D/ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
01-05 13:39:31.359 7233-7254/com.protoreactnative I/art: Thread[15,tid=7254,Native,Thread*=0xf2e86b00,peer=0x12dcf280,"Thread-4"] recursive attempt to load library "/data/app/com.protoreactnative-2/lib/arm/libfb.so"
01-05 13:39:31.364 7233-7254/com.protoreactnative D/ReactNative: ReactInstanceManager.createReactContext()
01-05 13:39:31.394 7233-7233/com.protoreactnative W/unknown:ReactNative: Packager connection already open, nooping.
01-05 13:39:31.396 7233-7258/com.protoreactnative D/libc: [NET] android_getaddrinfofornetcontext+,hn 9(0x6c6f63616c686f),sn(),hints(known),family 0,flags 1024, proc=com.protoreactnative
01-05 13:39:31.396 7233-7255/com.protoreactnative D/libc: [NET] android_getaddrinfofornetcontext+,hn 9(0x6c6f63616c686f),sn(),hints(known),family 0,flags 1024, proc=com.protoreactnative
01-05 13:39:31.396 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfofornetcontext+,hn 9(0x6c6f63616c686f),sn(),hints(known),family 0,flags 1024, proc=com.protoreactnative
01-05 13:39:31.397 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy get netid:0
01-05 13:39:31.397 7233-7255/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy get netid:0
01-05 13:39:31.399 7233-7255/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy-, success
01-05 13:39:31.401 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy-, success
01-05 13:39:31.402 7233-7258/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy get netid:0
01-05 13:39:31.403 7233-7258/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy-, success
01-05 13:39:31.411 7233-7257/com.protoreactnative W/unknown:InspectorPackagerConnection: Couldn't connect to packager, will silently retry
01-05 13:39:31.457 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
01-05 13:39:31.467 7233-7262/com.protoreactnative I/Adreno: QUALCOMM build : b756f35, I9267f384df
Build Date : 10/19/16
OpenGL ES Shader Compiler Version: XE031.09.00.03
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.BF64.1.2.3_RB1.07.00.00.258.005
Remote Branch : NONE
Reconstruct Branch : NOTHING
01-05 13:39:31.467 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
01-05 13:39:31.489 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
01-05 13:39:31.490 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
01-05 13:39:31.503 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
01-05 13:39:31.504 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
01-05 13:39:31.509 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
01-05 13:39:31.540 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
01-05 13:39:31.589 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
01-05 13:39:31.600 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
01-05 13:39:31.608 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
01-05 13:39:31.612 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
01-05 13:39:31.631 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
01-05 13:39:31.635 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
01-05 13:39:31.641 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
01-05 13:39:31.646 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
01-05 13:39:31.659 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
01-05 13:39:31.665 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
01-05 13:39:31.669 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
01-05 13:39:31.672 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
01-05 13:39:31.676 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
01-05 13:39:31.683 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
01-05 13:39:31.692 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
01-05 13:39:31.697 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
01-05 13:39:31.699 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
01-05 13:39:31.704 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
01-05 13:39:31.705 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
01-05 13:39:31.711 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
01-05 13:39:31.720 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
01-05 13:39:31.723 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
01-05 13:39:31.725 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
01-05 13:39:31.726 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
01-05 13:39:31.728 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
01-05 13:39:31.746 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
01-05 13:39:31.757 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
01-05 13:39:31.764 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
01-05 13:39:31.768 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
01-05 13:39:31.778 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
01-05 13:39:31.782 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
01-05 13:39:31.783 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
01-05 13:39:31.785 7233-7254/com.protoreactnative W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.protoreactnative.react.React3DViewManager
01-05 13:39:31.844 7233-7254/com.protoreactnative D/ReactNative: Initializing React Xplat Bridge.
01-05 13:39:31.849 7233-7254/com.protoreactnative D/ReactNative: Initializing React Xplat Bridge before initializeBridge
01-05 13:39:31.863 7233-7254/com.protoreactnative D/ReactNative: Initializing React Xplat Bridge after initializeBridge
01-05 13:39:31.863 7233-7254/com.protoreactnative D/ReactNative: CatalystInstanceImpl.runJSBundle()
01-05 13:39:31.864 7233-7270/com.protoreactnative D/ReactNative: ReactInstanceManager.setupReactContext()
01-05 13:39:31.864 7233-7270/com.protoreactnative D/ReactNative: CatalystInstanceImpl.initialize()
01-05 13:39:31.866 7233-7270/com.protoreactnative W/unknown:ReactNative: Packager connection already open, nooping.
01-05 13:39:31.871 7233-7270/com.protoreactnative D/ReactNative: ReactInstanceManager.attachRootViewToInstance()
01-05 13:39:32.249 7233-7270/com.protoreactnative I/WebViewFactory: Loading com.android.chrome version 62.0.3202.84 (code 320208452)
01-05 13:39:32.293 7233-7270/com.protoreactnative I/cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 2695-2701)
01-05 13:39:32.311 7233-7270/com.protoreactnative I/chromium: [INFO:library_loader_hooks.cc(46)] Chromium logging enabled: level = 0, default verbosity = 0
01-05 13:39:32.313 7233-7270/com.protoreactnative I/cr_LibraryLoader: Expected native library version number "62.0.3202.84", actual native library version number "62.0.3202.84"
01-05 13:39:32.467 7233-7237/com.protoreactnative I/art: Do partial code cache collection, code=31KB, data=30KB
01-05 13:39:32.467 7233-7237/com.protoreactnative I/art: After code cache collection, code=30KB, data=29KB
01-05 13:39:32.467 7233-7237/com.protoreactnative I/art: Increasing code cache capacity to 128KB
01-05 13:39:32.692 7233-7269/com.protoreactnative I/ReactNativeJS: Running application "protoreactnative" with appParams: {"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
01-05 13:40:29.776 7233-7233/com.protoreactnative I/Unity: onResume
01-05 13:40:29.797 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfofornetcontext+,hn 9(0x6c6f63616c686f),sn(),hints(known),family 0,flags 1024, proc=com.protoreactnative
01-05 13:40:29.797 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy get netid:0
01-05 13:40:29.799 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy-, success
01-05 13:40:29.827 7233-7233/com.protoreactnative D/Unity: SetWindow 0 0xe3b38e08
01-05 13:40:29.827 7233-7233/com.protoreactnative D/Unity: SetWindow 0 0xe3b38e08
01-05 13:40:31.871 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfofornetcontext+,hn 9(0x6c6f63616c686f),sn(),hints(known),family 0,flags 1024, proc=com.protoreactnative
01-05 13:40:31.872 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy get netid:0
01-05 13:40:31.881 7233-7257/com.protoreactnative D/libc: [NET] android_getaddrinfo_proxy-, success
最佳答案
有关更多信息,请在此处进行描述: Part 1 Part 2
好的,经过多次尝试,我找到了解决方案。将 UnityPlayer 连接到 MainActivity 的所有 Lifetime 非常重要。 ViewManager 类不支持所有 Activity 生命周期。您只需连接管理器即可恢复、暂停和销毁。但是 UnityPlayer 需要 onConfigurationChanged 来确保布局正确。我直接从 Unity 生成的类 UnityPlayerActivity 中获取代码,并在 ViewManager 中公开 UnityPlayer 以供使用。
这是我的 MainActivity 和 UnityPlayer init。
public class MainActivity extends ReactActivity {
private UnityPlayer mUnityPlayer;
public UnityPlayer getUnityPlayer() {
return mUnityPlayer;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFormat(PixelFormat.RGBX_8888); // <--- This makes xperia play happy
mUnityPlayer = new UnityPlayer(this);
}
public void onDestroy() {
super.onDestroy();
mUnityPlayer.quit();
}
public void onResume() {
super.onResume();
mUnityPlayer.resume();
}
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "protoreactnative";
}
// Low Memory Unity
@Override public void onLowMemory()
{
super.onLowMemory();
mUnityPlayer.lowMemory();
}
// Trim Memory Unity
@Override public void onTrimMemory(int level)
{
super.onTrimMemory(level);
if (level == TRIM_MEMORY_RUNNING_CRITICAL)
{
mUnityPlayer.lowMemory();
}
}
// This ensures the layout will be correct.
@Override public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
mUnityPlayer.configurationChanged(newConfig);
}
// Notify Unity of the focus change.
@Override public void onWindowFocusChanged(boolean hasFocus)
{
super.onWindowFocusChanged(hasFocus);
mUnityPlayer.windowFocusChanged(hasFocus);
}
// For some reason the multiple keyevent type is not supported by the ndk.
// Force event injection by overriding dispatchKeyEvent().
@Override public boolean dispatchKeyEvent(KeyEvent event)
{
if (event.getAction() == KeyEvent.ACTION_MULTIPLE)
return mUnityPlayer.injectEvent(event);
return super.dispatchKeyEvent(event);
}
// Pass any events not handled by (unfocused) views straight to UnityPlayer
@Override public boolean onKeyUp(int keyCode, KeyEvent event) { return mUnityPlayer.injectEvent(event); }
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { return mUnityPlayer.injectEvent(event); }
@Override public boolean onTouchEvent(MotionEvent event) { return mUnityPlayer.injectEvent(event); }
/*API12*/ public boolean onGenericMotionEvent(MotionEvent event) { return mUnityPlayer.injectEvent(event); }
}
这是 View 管理器:
public class React3DViewManager extends SimpleViewManager<UnityPlayer> {
public static final String REACT_CLASS = "RCT3DView";
@Override
public String getName() {
return REACT_CLASS;
}
@Override
protected UnityPlayer createViewInstance(ThemedReactContext reactContext) {
MainActivity activity = (MainActivity)reactContext.getCurrentActivity();
return activity.getUnityPlayer();
}
}
我不知道这个解决方案是否是最好的解决方案,但这个解决方案可以很好地满足我的需求。
谢谢
关于android - 在 react-native 应用程序中添加 Native Android UnityPlayer 导致黑屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48116993/
在这种情况下,我们在应用程序中同时使用react-native-gesture-handler Touchable和react-native Touchable。 (通过Touchables,我的意思
我有一个 MainFooter包含页脚和迷你播放器的组件,单击时动画显示为全 View 。我有一个问题,每当我们点击一个页脚选项卡时,播放器最大化然后卡在那里,没有响应。 此外,播放器内部的向下箭
我在 native react 之上使用 native 基础组件,我想知道如何在 UI 中使卡片呈圆形而不是矩形。有圆形的 Prop 吗? 最佳答案 好吧,实际上没有人能回答这个问题,但幸运的是我在
我在 native react 之上使用 native 基础组件,我想知道如何在 UI 中使卡片呈圆形而不是矩形。有圆形的 Prop 吗? 最佳答案 好吧,实际上没有人能回答这个问题,但幸运的是我在
我是 react-native 的新手,所以我认为“HTML”而不是“native”可能有点太多了,所以我的问题看起来很愚蠢。 我使用 react-native-router-flux 进行路由,并使
当我使用这个例子在我的应用程序上实现 Image-slider 时,我遇到了这个错误。 import React,{Component} from 'react' import {View,T
我正在为我们的产品使用“Native Base”组件,并且效果很好, 但我有一点被卡住了,它是关于将 Items 放入 Nativebase Picker 的问题。我的代码是这样的 渲染方法代码 -
正如文档中所建议的,我将一些长的数据获取代码移动到 native 模块中以释放 JS 线程,但我观察到这仍然阻塞了 UI。为什么会这样,我能做些什么来避免这种情况? 从 JS 调用 native 模块
我正在使用一个名为 react-native-svg 的框架在 React Native View 中绘制 SVG 元素。 我的目标是,当我点击 View 时(我在全局 View 上使用 PanRes
在 IOS 中发现错误 Native Module cannot be null 我不使用 react-native-push-notification 最佳答案 这通常发生在您未能将第三个库链接到您
当应用程序关闭时,我可以获得由 Linking.getInitialURL() 点击的深层链接网址。 .当应用程序处于后台状态时,则不会安装任何内容。所以,我什至无法通过 Linking.addEve
1) 说原生库是什么意思?什么样的图书馆?那些将用作 gradle 依赖项? 2)如何链接这些?我在使用 link 或 rnpm 时遇到了麻烦。 最佳答案 链接 native 库意味着您要将已经实现的
我需要帮助来构建我的 react 原生项目。我尝试过react-native run-android,但出现以下错误: react-native : The term 'react-native' i
我需要帮助来构建我的 react 原生项目。我尝试过react-native run-android,但出现以下错误: react-native : The term 'react-native' i
我是 React-Native 的新手,到目前为止我很喜欢它。我正在尝试创建一个屏幕(用于跨平台应用程序),右上角有一个菜单图标,单击时,我想打开一个菜单,希望使用 react-native-menu
RN doco 和其他示例展示了如何从 native iOS View Controller 启动 React-Native View ,但反之则不然。谁能解释一下我该怎么做? 最佳答案 我能够弄清楚
对于 react-native - WebStorm 用户: 我正在使用 Jet Brains IDE WebStorm 开始一个带有 React Native 的项目。 在项目 => node_mo
在升级过去的 react-native 0.60 之后......我被警告我应该取消链接所有手动链接的第 3 方库(因为 RN 现在通过自动链接处理它)。 但是,当我运行 react-native u
你可以使用像 https://github.com/tolu360/react-native-google-places 这样的库吗?在世博项目中?我假设任何 npm 库都可以添加,但是像这个 goo
我主要喜欢 React Native。自 0.22 以来一直在使用它。目前为 0.35。 但是为什么链接原生库就像抽奖一样呢?我很少在第一次拍摄时让它发挥作用,而破裂的东西通常是完全不同的东西。 每个
我是一名优秀的程序员,十分优秀!