|
@@ -16,6 +16,7 @@
|
16
|
16
|
UIButton* button = [[UIButton alloc] init];
|
17
|
17
|
[button addTarget:self action:@selector(onButtonPressed) forControlEvents:UIControlEventTouchUpInside];
|
18
|
18
|
[button setImage:iconImage forState:UIControlStateNormal];
|
|
19
|
+ [button setFrame:CGRectMake(0, 0, iconImage.size.width, iconImage.size.height)];
|
19
|
20
|
self = [super initWithCustomView:button];
|
20
|
21
|
self.buttonId = buttonId;
|
21
|
22
|
return self;
|
|
@@ -62,6 +63,7 @@
|
62
|
63
|
- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
|
63
|
64
|
self.widthConstraint.constant = rootView.intrinsicContentSize.width;
|
64
|
65
|
self.heightConstraint.constant = rootView.intrinsicContentSize.height;
|
|
66
|
+ [rootView setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
|
65
|
67
|
[rootView setNeedsUpdateConstraints];
|
66
|
68
|
[rootView updateConstraintsIfNeeded];
|
67
|
69
|
}
|