iphone-5

Same xib for iPhone4 and iPhone5 possible?

强颜欢笑 提交于 2019-11-26 19:20:23
问题 Is there any way I can design my classes for both iPhone4 and iPhone5 using the same xib? 回答1: Yes, you can use the same XIB to design for iPhone 4 and iPhone 5 by using Auto-Layout. Build an app using iOS 6 as the Base SDK and use the Auto Layout feature to make screens that can scale for all type of screens. You'll need Xcode 4.5 to do this. Get started with Auto Layout here: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2 http://www.raywenderlich.com/20897/beginning

Black bars appear in app when targeting iOS7.1 or 7.0 in Xcode6

丶灬走出姿态 提交于 2019-11-26 17:56:43
问题 Steps to reproduce: Create a new project using Xcode6 (single view template, iPhone only, Objective-C) Navigate to project settings and change the deployment target from 8.0 to 7.1 Run the application on a iPhone5/S with 7.1 installed or in the iPhone5/s 7.1 simulator (You may have to download the iOS7.1 simulators) The app appears with black bars on the top and the bottom. If you run the application on the iPhone5/S 8.0 simulator, the screen will appear as expected, all white. Why is this

Set rootViewController of UINavigationController by method other than initWithRootViewController

孤人 提交于 2019-11-26 15:36:50
问题 How Do I set the rootViewController of UINavigationController by a method other than initWithRootViewController ? I want use initWithNavigationBarClass:toolbarClass: to deliver a custom toolbar for my NavigationController, so I don't think I can use initWithRootViewController . 回答1: You can solve this by calling setViewControllers . Like this: UINavigationController *navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[MyNavigationBar class] toolbarClass:

Black bars on launch screen on iPhone5 (and iPhone6)

坚强是说给别人听的谎言 提交于 2019-11-26 12:27:36
When iPhone 5 first came out we had to go through the silliness of adding a Default-568h@2x.png to the project to get the app to use the full height of the iPhone 5. In late 2014 are we still doing that? We have asset catalogs and the LaunchScreen.xib file. Do we still need to add the Default-568h@2x.png file? If so, where does it go now? I've tried a few different things and I can't get rid of the black bars in a new app created with Xcode 6 GM. As stated by rmaddy in the comments, if you are supporting iOS < 8, you still need to do this: General / App Icons and Launch Images Launch Image

Creating a percentage based iOS layout

放肆的年华 提交于 2019-11-26 12:00:05
问题 I\'m trying to replicate a layout that I currently have in an Android application, but I don\'t know how to go about it in iOS especially because of the tallness of the iPhone 5. I know how to explain this in \"Android\" terms but I\'ve been trying for the past few days to do this in iOS but I can\'t quite get it to work. Best way to explain it: I want two layouts. The top layout must take up 40% and the bottom must take up 60%. In the top layout, they must be three buttons that fill up all

Hardware-dependent NSDateFormatter dateFromString: bug (returns nil)

余生长醉 提交于 2019-11-26 11:35:53
问题 I have several date strings that I need to convert to NSDates. My parsing code is the following: NSString *s = [pair objectForKey:@\"nodeContent\"]; NSDateFormatter *f = [[NSDateFormatter alloc] init]; [f setDateFormat:@\"yyyy-MM-dd\'T\'HH:mm:ssZZ\"]; self.date = [f dateFromString:s]; The above code works fine in all the devices and simulators we\'ve tested. The strange thing is that when the above code runs on any iPhone 5 running iOS 6.1 or 7.0.x , the line self.date = [f dateFromString:s];

iPhone 5 CSS media query

冷暖自知 提交于 2019-11-26 09:10:57
The iPhone 5 has a longer screen and it's not catching my website's mobile view. What are the new responsive design queries for the iPhone 5 and can I combine with existing iPhone queries? My current media query is this: @media only screen and (max-device-width: 480px) {} 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

How to create Custom MKAnnotationView and custom annotation title and subtitle

会有一股神秘感。 提交于 2019-11-26 07:34:09
问题 I need to create above Annotation view on MKMapView. I am able to create the custom annotation view but on the tap of annotation the view need to be opened image with that big text, I am not able to create that one. Please provide me some links or the way to do this task. 回答1: To create a custom annotation view (your replacement for the standard pin), you can just set the image property of the MKAnnotationView in the viewForAnnotation method: - (MKAnnotationView *)mapView:(MKMapView *)mapView

Black bars on launch screen on iPhone5 (and iPhone6)

只愿长相守 提交于 2019-11-26 02:58:17
问题 When iPhone 5 first came out we had to go through the silliness of adding a Default-568h@2x.png to the project to get the app to use the full height of the iPhone 5. In late 2014 are we still doing that? We have asset catalogs and the LaunchScreen.xib file. Do we still need to add the Default-568h@2x.png file? If so, where does it go now? I\'ve tried a few different things and I can\'t get rid of the black bars in a new app created with Xcode 6 GM. 回答1: As stated by rmaddy in the comments, if

iPhone 5 CSS media query

走远了吗. 提交于 2019-11-26 02:02:56
问题 The iPhone 5 has a longer screen and it\'s not catching my website\'s mobile view. What are the new responsive design queries for the iPhone 5 and can I combine with existing iPhone queries? My current media query is this: @media only screen and (max-device-width: 480px) {} 回答1: 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