About: fix scroll view

This commit is contained in:
Gautier Pelloux-Prayer 2015-10-28 10:52:03 +01:00
parent c383bafb9a
commit d875ecb7ca
3 changed files with 18 additions and 15 deletions

View file

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

View file

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

View file

@ -8,11 +8,13 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AboutView">
<connections>
<outlet property="copyrightLabel" destination="58" id="72"/>
<outlet property="licenseLabel" destination="61" id="wfl-pd-xb6"/>
<outlet property="licensesView" destination="69" id="70"/>
<outlet property="linkLabel" destination="57" id="60"/>
<outlet property="linphoneCoreVersionLabel" destination="66" id="67"/>
<outlet property="linphoneIphoneVersionLabel" destination="65" id="68"/>
<outlet property="linphoneLabel" destination="56" id="71"/>
<outlet property="scrollView" destination="62" id="N9t-Th-sGO"/>
<outlet property="view" destination="HJH-1o-RXN" id="IOA-1R-a1O"/>
</connections>
</placeholder>
@ -77,6 +79,9 @@
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.81176471709999998" green="0.29803922770000002" blue="0.16078431900000001" alpha="1" colorSpace="deviceRGB"/>
<nil key="highlightedColor"/>
<connections>
<outletCollection property="gestureRecognizers" destination="l7c-wq-pii" appends="YES" id="KgK-0M-UKA"/>
</connections>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Linphone iPhone 1.0 (placeholder)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="65" userLabel="linphoneIphoneVersionLabel">
<rect key="frame" x="10" y="123" width="355" height="18"/>
@ -122,6 +127,11 @@
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="235.5" y="362.5"/>
</view>
<tapGestureRecognizer id="l7c-wq-pii" userLabel="onLinkTap">
<connections>
<action selector="onLinkTap:" destination="-1" id="Ay5-Uz-RDo"/>
</connections>
</tapGestureRecognizer>
</objects>
<resources>
<image name="color_E.png" width="2" height="2"/>