瀏覽代碼

center customTitleView fixed for xcode 8 builds

yogevbd 6 年之前
父節點
當前提交
0c8054b8ff
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      ios/RCCCustomTitleView.m

+ 1
- 1
ios/RCCCustomTitleView.m 查看文件

@@ -54,7 +54,7 @@
54 54
 
55 55
 - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
56 56
     if ([self.alignment isEqualToString:@"center"]) {
57
-        [self setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
57
+        [self setFrame:CGRectMake(self.frame.origin.x, self.frame.origin.y, self.subView.intrinsicContentSize.width, self.subView.intrinsicContentSize.height)];
58 58
         [self.subView setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
59 59
     }
60 60
 }