Sfoglia il codice sorgente

Custom titleView layout fix

yogevbd 6 anni fa
parent
commit
9391cd52fd
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8
    1
      lib/ios/RNNCustomTitleView.m

+ 8
- 1
lib/ios/RNNCustomTitleView.m Vedi File

@@ -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