Creating a percentage based iOS layout

Using Xcode 6.0, you can now specify proportional width or height in Interface Builder. Steps for percentage height from superview: While both the child view and its superview are selected, add an “equal height” constraint (or “equal width” if you wish to have a proportional width). Then change the “multiplier” of the constraint you just … Read more

Black bars showing when running app on iOS 7 (4 inch retina display)

First thing is that you must add the required default image for 4 inch screen display. Check Properly in you project have image with name Default-568h@2x.png (640 × 1136 pixels) This Default-568h@2x.png is Necessary for Support app in 4 inch Screen display Ones you add this image in to you working Project, Remove old Build … Read more

Set rootViewController of UINavigationController by method other than initWithRootViewController

You can solve this by calling setViewControllers. Like this: UINavigationController *navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[MyNavigationBar class] toolbarClass:[UIToolbar class]]; [navigationController setViewControllers:@[yourRootViewController] animated:NO]; Swift version: let navigationController = UINavigationController(navigationBarClass: MyNavigationBar.self, toolbarClass: UIToolbar.self) navigationController.setViewControllers([yourRootViewController], animated: false)

iPhone 5 CSS media query

Another useful media feature is device-aspect-ratio. Note that the iPhone 5 does not have a 16:9 aspect ratio. It is in fact 40:71. iPhone < 5: @media screen and (device-aspect-ratio: 2/3) {} iPhone 5: @media screen and (device-aspect-ratio: 40/71) {} iPhone 6: @media screen and (device-aspect-ratio: 375/667) {} iPhone 6 Plus: @media screen and (device-aspect-ratio: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)