diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index e430c43a5..68c2377aa 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -113,10 +113,20 @@ static UICompositeViewDescription *compositeDescription = nil; } } -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { +- (void)fitContent { + // always resize content view so that it fits whole available width + CGRect frame = currentView.frame; + frame.size.width = _contentView.bounds.size.width; + currentView.frame = frame; + + [_contentView setContentSize:frame.size]; [_contentView contentSizeToFit]; } +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { + [self fitContent]; +} + #pragma mark - Utils - (void)resetLiblinphone { @@ -300,9 +310,9 @@ static UICompositeViewDescription *compositeDescription = nil; // Set current view currentView = view; - [_contentView insertSubview:view atIndex:0]; - [view setFrame:[_contentView bounds]]; - [_contentView setContentSize:[view bounds].size]; + [_contentView insertSubview:currentView atIndex:0]; + [_contentView setContentOffset:CGPointMake(0, -_contentView.contentInset.top) animated:NO]; + [self fitContent]; // Resize next button to fix text length UIButton *button = [self findButton:ViewElement_NextButton]; diff --git a/Classes/Base.lproj/AssistantView.xib b/Classes/Base.lproj/AssistantView.xib index e2553fa36..77f0ca5b5 100644 --- a/Classes/Base.lproj/AssistantView.xib +++ b/Classes/Base.lproj/AssistantView.xib @@ -1,8 +1,8 @@ - + - + @@ -75,7 +75,7 @@ - + diff --git a/Classes/Base.lproj/AssistantViewScreens.xib b/Classes/Base.lproj/AssistantViewScreens.xib index 5bfb95b2b..613f40907 100644 --- a/Classes/Base.lproj/AssistantViewScreens.xib +++ b/Classes/Base.lproj/AssistantViewScreens.xib @@ -22,8 +22,8 @@ - - + + - - + + - - + +