From d875ecb7ca2708638731a9e4a331838992cc49d4 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 28 Oct 2015 10:52:03 +0100 Subject: [PATCH] About: fix scroll view --- Classes/AboutView.h | 2 +- Classes/AboutView.m | 21 +++++++-------------- Classes/Base.lproj/AboutView.xib | 10 ++++++++++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Classes/AboutView.h b/Classes/AboutView.h index c4990602a..071be403b 100644 --- a/Classes/AboutView.h +++ b/Classes/AboutView.h @@ -31,7 +31,7 @@ @property(nonatomic, strong) IBOutlet UILabel *copyrightLabel; @property(nonatomic, strong) IBOutlet UILabel *licenseLabel; @property(nonatomic, strong) IBOutlet UIWebView *licensesView; -@property(nonatomic, strong) IBOutlet UITapGestureRecognizer *linkTapGestureRecognizer; +@property(weak, nonatomic) IBOutlet UIScrollView *scrollView; - (IBAction)onLinkTap:(id)sender; - (IBAction)onDialerBackClick:(id)sender; diff --git a/Classes/AboutView.m b/Classes/AboutView.m index 8bb2f0e7f..02a32b4b0 100644 --- a/Classes/AboutView.m +++ b/Classes/AboutView.m @@ -24,23 +24,11 @@ @implementation AboutView -#pragma mark - Lifecycle Functions - -- (id)init { - self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]]; - if (self != nil) { - _linkTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onLinkTap:)]; - } - return self; -} - #pragma mark - ViewController Functions - (void)viewDidLoad { [super viewDidLoad]; - [_linkLabel addGestureRecognizer:_linkTapGestureRecognizer]; - [_linphoneLabel setText:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]]; [_linphoneIphoneVersionLabel @@ -114,9 +102,14 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)webViewDidFinishLoad:(UIWebView *)webView { CGSize size = [webView sizeThatFits:CGSizeMake(self.view.bounds.size.width, 10000.0f)]; float diff = size.height - webView.bounds.size.height; - // _contentFrame.size.height += diff; - // [scrollView setContentSize:contentFrame.size]; + UIScrollView *scrollView = (UIScrollView *)self.view; + CGRect contentFrame = [scrollView bounds]; + contentFrame.size.height += diff; + [scrollView setAutoresizesSubviews:FALSE]; + [scrollView setFrame:contentFrame]; + [scrollView setAutoresizesSubviews:TRUE]; + [_scrollView setContentSize:contentFrame.size]; CGRect licensesViewFrame = [_licensesView frame]; licensesViewFrame.size.height += diff; [_licensesView setFrame:licensesViewFrame]; diff --git a/Classes/Base.lproj/AboutView.xib b/Classes/Base.lproj/AboutView.xib index 77fa8122c..f6118491a 100644 --- a/Classes/Base.lproj/AboutView.xib +++ b/Classes/Base.lproj/AboutView.xib @@ -8,11 +8,13 @@ + + @@ -77,6 +79,9 @@ + + +