ReactNative开发中如何去掉iOS状态栏的"Loading from..."

来源:互联网 发布:laravel nginx 编辑:程序博客网 时间:2024/04/30 21:18

学习RN初级,在加载的时候总是会在ios app屏幕上方出现绿色的条,显示loading from和进度,只要屏蔽掉如下的代码就可以了。

在RCTDevLoadingView.m中屏蔽 

RCT_EXPORT_METHOD(showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor)

{

  if (!isEnabled) {

    return;

  }


//  dispatch_async(dispatch_get_main_queue(), ^{

//    self->_showDate = [NSDate date];

//    if (!self->_window && !RCTRunningInTestEnvironment()) {

//      CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;

//      self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 22)];

//#if TARGET_OS_TV

//      self->_window.windowLevel = UIWindowLevelNormal + 1;

//#else

//      self->_window.windowLevel = UIWindowLevelStatusBar + 1;

//#endif

//      // set a root VC so rotation is supported

//      self->_window.rootViewController = [UIViewController new];

//

//      self->_label = [[UILabel alloc] initWithFrame:self->_window.bounds];

//      self->_label.font = [UIFont systemFontOfSize:12.0];

//      self->_label.textAlignment = NSTextAlignmentCenter;

//

//      [self->_window addSubview:self->_label];

//    }

//

//    self->_label.text = message;

//    self->_label.textColor = color;

//    self->_window.backgroundColor = backgroundColor;

//    self->_window.hidden = NO;

//  });

}


0 0
原创粉丝点击