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
This commit is contained in:
Nick Lockwood 2015-10-23 09:11:54 -07:00 committed by facebook-github-bot-4
parent ed0b45ef8e
commit b0b9a56ef8
3 changed files with 4 additions and 9 deletions

View File

@ -74,8 +74,8 @@ var ActivityIndicatorIOS = React.createClass({
return (
<View
onLayout={onLayout}
style={[styles.container, sizeStyle, style]}>
<RCTActivityIndicatorView {...props} />
style={[styles.container, style]}>
<RCTActivityIndicatorView {...props} style={sizeStyle} />
</View>
);
}

View File

@ -47,11 +47,6 @@ const CGFloat RCTMapZoomBoundBuffer = 0.01;
[_regionChangeObserveTimer invalidate];
}
- (void)reactSetFrame:(CGRect)frame
{
self.frame = frame;
}
- (void)layoutSubviews
{
[super layoutSubviews];

View File

@ -78,8 +78,8 @@
return;
}
self.layer.position = position;
self.layer.bounds = bounds;
self.center = position;
self.bounds = bounds;
}
- (void)reactSetInheritedBackgroundColor:(UIColor *)inheritedBackgroundColor