瀏覽代碼

Custom titleView layout fix

yogevbd 6 年之前
父節點
當前提交
9391cd52fd
共有 1 個檔案被更改,包括 8 行新增1 行删除
  1. 8
    1
      lib/ios/RNNCustomTitleView.m

+ 8
- 1
lib/ios/RNNCustomTitleView.m 查看文件

@@ -33,10 +33,17 @@
33 33
 	return self;
34 34
 }
35 35
 
36
+- (CGSize)sizeThatFits:(CGSize)size {
37
+	if ([self.alignment isEqualToString:@"fill"]) {
38
+		return size;
39
+	}
40
+	return [super sizeThatFits:size];
41
+}
42
+
36 43
 - (void)layoutSubviews {
37 44
 	[super layoutSubviews];
38 45
 	if ([self.alignment isEqualToString:@"fill"]) {
39
-		[self.subView setFrame:self.bounds];
46
+		[self.subView setFrame:self.frame];
40 47
 	}
41 48
 }
42 49