Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong 'margin' behavior on iOS RN 0.59 #24685

Closed
serjiogunit opened this issue May 2, 2019 · 8 comments
Closed

Wrong 'margin' behavior on iOS RN 0.59 #24685

serjiogunit opened this issue May 2, 2019 · 8 comments
Labels
Bug Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@serjiogunit
Copy link

🐛 Bug Report

Empty screen if some of component contains 'margin' value. Reproduces on simulator and real iPhone.
Screen Shot 2019-05-02 at 12 36 56

To Reproduce

Add 'margin' to component

Expected Behavior

Correct layout

Code Example

import React, {Component} from 'react';
import {AppRegistry, Text, View} from 'react-native';

class TestApp extends Component {
  render() {
    return (
      <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
        <Text style={{marginTop: 50}}>Hello, world!</Text>
      </View>
    );
  }
}

AppRegistry.registerComponent('TestApp', () => TestApp);

Environment

React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
Memory: 33.70 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 9.8.0 - ~/.nvm/versions/node/v10.2.1/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.1.0 - ~/.nvm/versions/node/v10.2.1/bin/npm
Watchman: 4.4.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.3, 27.0.0, 27.0.3, 28.0.1, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: ^16.8.3 => 16.8.6
react-native: ^0.59.6 => 0.59.6
npmGlobalPackages:
react-native-cookies: 3.3.0

@bobber205
Copy link

can you add a expo example?

@serjiogunit
Copy link
Author

serjiogunit commented May 6, 2019

Here is my AppDelegate.m file
0.58.6 version works fine.
0.59.0 has the same bug.

/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"TestApp"
                                            initialProperties:nil];

  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  return YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end

@bobber205
Copy link

Can you try upgrading to the latest RN version?

@serjiogunit
Copy link
Author

Can you try upgrading to the latest RN version?

@bobber205 hello, yes. I tried all 0.59.X versions.

@passerbyloo
Copy link

I tried 0.59.8 version, iOS 12.1, iPhone XS, can not reproduce

@serjiogunit
Copy link
Author

0.59.8 still contains this bug for me

@stale
Copy link

stale bot commented Aug 20, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 20, 2019
@stale
Copy link

stale bot commented Aug 27, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 27, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants