Skip to content

Wrong 'margin' behavior on iOS RN 0.59聽#24685

Closed

Description

@serjiogunit

馃悰 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

Activity

  1. bobber205 commented on May 2, 2019

    @bobber205

    can you add a expo example?

  2. serjiogunit commented on May 6, 2019

    @serjiogunit
    Author

    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
    
    
  3. bobber205 commented on May 6, 2019

    @bobber205

    Can you try upgrading to the latest RN version?

  4. serjiogunit commented on May 7, 2019

    @serjiogunit
    Author

    Can you try upgrading to the latest RN version?

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

  5. passerbyloo commented on May 16, 2019

    @passerbyloo

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

  6. serjiogunit commented on May 22, 2019

    @serjiogunit
    Author

    0.59.8 still contains this bug for me

  7. stale commented on Aug 20, 2019

    @stale

    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.

  8. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Aug 20, 2019
  9. stale commented on Aug 27, 2019

    @stale

    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.

  10. locked as resolved and limited conversation to collaborators on Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPlatform: iOSiOS applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions