Skip to content

Commit b0b9a56

Browse files
nicklockwoodfacebook-github-bot-4
authored andcommitted
Fixed ActivityIndicatorIOS layout
Summary: public This has been broken for a while. The styles in the JS were being set on the container instead of the activity view itself. Also, due to the way frames were set directly on layer properties instead of the view, resizing didn't work properly because the UIImageView inside the UIActivityView was not being realligned when the bounds changed. This also caused problems for other controls such as maps, where it was fixed with a method override, but the simpler solution is just to set the view center and bounds directly. Before: {F23631143} After: {F23631144} Reviewed By: javache, tadeuzagallo Differential Revision: D2575156 fb-gh-sync-id: e82e56d36648e7c924df77da1750e03037b5d5be
1 parent ed0b45e commit b0b9a56

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ var ActivityIndicatorIOS = React.createClass({
7474
return (
7575
<View
7676
onLayout={onLayout}
77-
style={[styles.container, sizeStyle, style]}>
78-
<RCTActivityIndicatorView {...props} />
77+
style={[styles.container, style]}>
78+
<RCTActivityIndicatorView {...props} style={sizeStyle} />
7979
</View>
8080
);
8181
}

React/Views/RCTMap.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ - (void)dealloc
4747
[_regionChangeObserveTimer invalidate];
4848
}
4949

50-
- (void)reactSetFrame:(CGRect)frame
51-
{
52-
self.frame = frame;
53-
}
54-
5550
- (void)layoutSubviews
5651
{
5752
[super layoutSubviews];

React/Views/UIView+React.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ - (void)reactSetFrame:(CGRect)frame
7878
return;
7979
}
8080

81-
self.layer.position = position;
82-
self.layer.bounds = bounds;
81+
self.center = position;
82+
self.bounds = bounds;
8383
}
8484

8585
- (void)reactSetInheritedBackgroundColor:(UIColor *)inheritedBackgroundColor

0 commit comments

Comments
 (0)