ios6

Prevent autorotate for one view controller?

匆匆过客 提交于 2019-12-18 11:25:44
问题 My app can autorotate but I need one of the views to only show in portrait mode and don't know how to achieve this. I tried this (among other things) but the view in question still rotates: // ViewController.m -(BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } Can someone kindly point out what I'm doing wrong? Thanks. -edit- It's for iOS 6.1 回答1: When a UINavigationController is involved, create a category on the

Display images in a UICollectionView - how to achieve fixed vertical spacing between images?

[亡魂溺海] 提交于 2019-12-18 11:15:08
问题 I am using a UICollectionView to present a grid of images in an iPhone app (iOS6). I am using vertical scrolling for the UICollectionView, and the images all have fixed width and varying height. The width of the images are set so that on an iPhone, it displays 3 columns of images. This works ok, and I get the images presented in a grid view. However, since my images have varying height, the vertical spacing between images in a column varies and this doesn't look very good, as you can see in

Querying Facebook user data through new iOS6 social framework

帅比萌擦擦* 提交于 2019-12-18 11:13:18
问题 I am trying to query information about a user using iOS 6's new Facebook integration API. This is the code I'm using, which is basically identical to what they demoed at WWDC: { NSDictionary *parameters = @{}; NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me"]; SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters:parameters]; request.account = self.account; [request performRequestWithHandler:^(NSData

dequeueReusableCellWithIdentifier error in my UITableView in iOS5

限于喜欢 提交于 2019-12-18 10:15:17
问题 I am getting this error in iOS 5 -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0xa217200 However, I get no errors in iOS 6. How can I fix this problem? Here's my code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"MyCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; /// SIGABRT

Interpret XMP-Metadata in ALAssetRepresentation

六眼飞鱼酱① 提交于 2019-12-18 10:13:33
问题 When a user makes some changes (cropping, red-eye removal, ...) to photos in the built-in Photos.app on iOS, the changes are not applied to the fullResolutionImage returned by the corresponding ALAssetRepresentation . However, the changes are applied to the thumbnail and the fullScreenImage returned by the ALAssetRepresentation . Furthermore, information about the applied changes can be found in the ALAssetRepresentation 's metadata dictionary via the key @"AdjustmentXMP" . I would like to

Different Initial interface orientation iPhone and iPad universal application

牧云@^-^@ 提交于 2019-12-18 09:45:09
问题 What I want is Portrait orientation for iPhone and Landscape orientation for iPad app. My app is targeted for > ios5 I searched on web about this but got different answers but not the exact one. 回答1: So here is what I did For iPhone and for iPad And for iPad controllers I added below code, this is not necessary for ios6 applications - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeRight

show all tabs with scrolling option (on screen there should be only 4 tabs)

只谈情不闲聊 提交于 2019-12-18 09:33:23
问题 I am newbie for iOS development. What I have done so far is as below. Created New Project Removed all controller and added View Controller. Dragged ScrollView in ViewController Dragged Tab Bar in ScrollView Dragged 7 Tab Bar Item in Tab Bar . Now when I execute this project, I have all 7 tabs on screen which is not looking good. So what I am planning is display only 4 tab at first and if user scroll it horizontally, user can scroll and see rest tabs. So, what I want to achieve is

show all tabs with scrolling option (on screen there should be only 4 tabs)

半腔热情 提交于 2019-12-18 09:30:03
问题 I am newbie for iOS development. What I have done so far is as below. Created New Project Removed all controller and added View Controller. Dragged ScrollView in ViewController Dragged Tab Bar in ScrollView Dragged 7 Tab Bar Item in Tab Bar . Now when I execute this project, I have all 7 tabs on screen which is not looking good. So what I am planning is display only 4 tab at first and if user scroll it horizontally, user can scroll and see rest tabs. So, what I want to achieve is

Customize iOS 7 status bar text Color

ぃ、小莉子 提交于 2019-12-18 09:07:32
问题 I want to know if there is a way to change the iOS 7 status bar text color besides black and white color? 回答1: Theoretically this is possible. You will need to read about private api's on iOS. Here is o good place to start with UIStatusBar example: http://b2cloud.com.au/tutorial/using-private-ios-apis/ Keep in mind that probably you won't be able to submit your app on Appstore if you would use private api. 回答2: Put this in your AppDelegate application:didFinishLaunchingWithOptions: Swift 4.2:

UINavigationController popViewControllerAnimated: crash in iOS 6

血红的双手。 提交于 2019-12-18 08:55:14
问题 The code below works fine in iOS 4 and 5 but crashes in iOS 6 with EXC_BAD_ACCESS . I'd appreciate any help in troubleshooting it. This code is being called in a UITableViewController that handles my app's search logic: CATransition *transition = [CATransition animation]; transition.duration = 0.3f; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; transition.type = kCATransitionFade; [self.navigationController.view.layer addAnimation