From 84e22d780f298bd59ce9e5c19e89f69f1f37b16a Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 29 Oct 2015 10:11:48 +0100 Subject: [PATCH] About: fix scroll --- Classes/AboutView.h | 2 +- Classes/AboutView.m | 16 ++++++++++------ Classes/Base.lproj/AboutView.xib | 31 +++++++++++++++++++------------ 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/Classes/AboutView.h b/Classes/AboutView.h index 071be403b..cf06159a4 100644 --- a/Classes/AboutView.h +++ b/Classes/AboutView.h @@ -30,8 +30,8 @@ @property(nonatomic, strong) IBOutlet UILabel *linkLabel; @property(nonatomic, strong) IBOutlet UILabel *copyrightLabel; @property(nonatomic, strong) IBOutlet UILabel *licenseLabel; +@property(weak, nonatomic) IBOutlet UIView *contentView; @property(nonatomic, strong) IBOutlet UIWebView *licensesView; -@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 f0162f841..a11566bef 100644 --- a/Classes/AboutView.m +++ b/Classes/AboutView.m @@ -29,6 +29,10 @@ - (void)viewDidLoad { [super viewDidLoad]; + UIScrollView *scrollView = (UIScrollView *)self.view; + [scrollView addSubview:_contentView]; + [scrollView setContentSize:[_contentView bounds].size]; + [_linphoneLabel setText:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]]; [_linphoneIphoneVersionLabel @@ -104,13 +108,13 @@ static UICompositeViewDescription *compositeDescription = nil; CGSize size = [webView sizeThatFits:CGSizeMake(self.view.bounds.size.width, 10000.0f)]; float diff = size.height - webView.bounds.size.height; - UIScrollView *scrollView = (UIScrollView *)self.view; - CGRect contentFrame = [scrollView bounds]; + CGRect contentFrame = [self.view bounds]; contentFrame.size.height += diff; - [scrollView setAutoresizesSubviews:FALSE]; - [scrollView setFrame:contentFrame]; - [scrollView setAutoresizesSubviews:TRUE]; - [_scrollView setContentSize:contentFrame.size]; + [_contentView setAutoresizesSubviews:FALSE]; + [_contentView setFrame:contentFrame]; + [_contentView setAutoresizesSubviews:TRUE]; + [(UIScrollView *)self.view 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 f6118491a..8045b7875 100644 --- a/Classes/Base.lproj/AboutView.xib +++ b/Classes/Base.lproj/AboutView.xib @@ -7,6 +7,7 @@ + @@ -14,8 +15,7 @@ - - + @@ -25,18 +25,18 @@ - + - - + + - + - + @@ -116,9 +116,8 @@ - - - + + @@ -132,6 +131,14 @@ + + + + + + + +