浏览代码

Custom titleView layout fix

yogevbd 7 年前
父节点
当前提交
9391cd52fd
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8
    1
      lib/ios/RNNCustomTitleView.m

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

33
 	return self;
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
 - (void)layoutSubviews {
43
 - (void)layoutSubviews {
37
 	[super layoutSubviews];
44
 	[super layoutSubviews];
38
 	if ([self.alignment isEqualToString:@"fill"]) {
45
 	if ([self.alignment isEqualToString:@"fill"]) {
39
-		[self.subView setFrame:self.bounds];
46
+		[self.subView setFrame:self.frame];
40
 	}
47
 	}
41
 }
48
 }
42
 
49