I have a View Controller that creates its view programatically through the loadView
method. The purpose of the view is to display a data models contents. When the v
Try following:
Toolbar.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
My problem was solved unmarking the check "Adjust Scroll View Insets" in the View Controller (using Storyboards).
try this
CGRect frame = CGRectMake(0, StatusBarHeight, [Constants ScreenWidth], [Constants ScreenHeight] - StatusBarHeight - ToolbarHeight);
self.view = [[UIView alloc] initWithFrame:frame];
self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight;
self.view.autoresizesSubviews = YES;
self.view.backgroundColor = [Constants categoriesScreenBackgroundColor];
CGRect scrollFrame = CGRectMake(0, StatusBarHeight, [Constants ScreenWidth], [Constants ScreenHeight] - StatusBarHeight - ToolbarHeight - ToolbarHeight);
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollFrame];
scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight |
UIViewAutoresizingFlexibleBottomMargin |
UIViewAutoresizingFlexibleTopMargin;
[self.view addSubview:scrollView];
Add following code its work for me for same issue, may be its help you
/* ios 7 Change */
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
self.edgesForExtendedLayout = UIRectEdgeNone;
self.automaticallyAdjustsScrollViewInsets = NO;
}
I think the problem is due to incorrect automatic set of content insets of the scrollview.
Try the following. In your loadView
, set self.automaticallyAdjustsScrollViewInsets
to NO
(only if NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1
). Now, set the contentInset
and scrollIndicatorInsets
to the correct values depending on OS version:
scrollview.contentInset = scrollview.scrollIndicatorInsets = UIEdgeInsetMake(NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1 ? 0 : 64, 0, 0, 0);
Does this only happen on iOS 7?
Give this a try:
self.navigationController.navigationBar.translucent = NO;