ios5

Using UIAppearance to change label height

我们两清 提交于 2020-01-11 06:53:05
问题 Is there any way to use UIAppearance to change the height of a label inside of a UINavigationBar. Here's the code and an image of what's going on so you can understand what the problem is. [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:-5.0 forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:-5.0 forBarMetrics:UIBarMetricsLandscapePhone]; NSDictionary *textAttributes = [NSDictionary dictionaryWithObjects:[NSArray

UIEdgeInsets ignored on CGContextDrawImage within a UIGraphicsBeginImageContextWithOptions

亡梦爱人 提交于 2020-01-11 06:00:26
问题 I am struggling getting Image Insets to work when drawing to an off screen buffer. Using the resizableImageWithCapInsets: on an UIImage directly setImage: into a button works fine for me: UIImage * base = [UIImage imageNamed:@"button.png"]; UIImage * img = [base resizableImageWithCapInsets:UIEdgeInsetsMake(20,20,20,20)]; [self setImage:img forState:UIControlStateNormal]; As shown below (left is raw scaling, right is scaled with insets): So the right one is fine - the lines top/botton/left

Is it possible to have my closed app run code in iOS?

天涯浪子 提交于 2020-01-11 05:44:05
问题 Let's say that my app in iOS is closed. Would it be possible to set it up so that it runs a piece of its code after a certain period of time? 回答1: You can have your app schedule push notifications, but you can't schedule it to run specific code unless it's running. 回答2: Short answer: no, you can not. At the most, your application will keep running in the background for 11 minutes, if you request the extra time (check the documentation for beginBackgroundTaskWithExpirationHandler on the

Cancel local notification not working

天涯浪子 提交于 2020-01-11 02:21:26
问题 I've spent half of my day reading all "How to cancel a local notification" questions and answers. After all, I came up with my own solution but apparently it is not working. I have a tableview with all my scheduled notifications.... on the H file I have @property (strong, nonatomic) UILocalNotification *theNotification; and then on the M file: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *notificationArray = [[UIApplication

Check if iOS app is live in app store

ぃ、小莉子 提交于 2020-01-10 08:51:12
问题 Is it possible somehow to code like below in iOS app ? if(app is live in app store) { //Do something } else { //Do other thing } I wanted to avoid cases where our QE/Dev team is using app for testing. Is there a way I can detect how app code is signed (Developer/Adhoc/Distribution) to check ? Even if it is possible, it will not eliminate cases when Apple is using our app for testing as part of review. We recorded many downloads of our content by Apple before our app goes live in App store.

UILocalNotification is supposed to repeat every weekday, but fires on weekends as well

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-10 07:58:13
问题 I have a UILocalNotification that is supposed to fire once a day, Monday through Friday, but not on the weekend. I thought that setting the repeatInterval property of the notification to NSWeekdayCalendarUnit would accomplish this. Sadly for me, my notifications are still firing on the weekend. Can anyone suggest why? Here is my code: UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.alertAction = @"View"; localNotification.alertBody =

dismissViewControllerAnimated crash at ios5

你离开我真会死。 提交于 2020-01-10 05:45:07
问题 Does the code crash, because of a circular reference? MenuController: UIViewController - (id)initWithNibName: {... TabsController *tabs = [[TabsController alloc] initWithNibName:@"TabsController" bundle:nil]; self.tab = tabs; .... } //button pressed: - (IBAction)showPrefFromMenu:(id)sender { // todo change delegate!? tab.tabDelegate = self; [self presentModalViewController:tab animated:YES]; //[tab release]; } // delegate method: -(void)myViewDismissed { .... NSLog(@"tab references: %d", [tab

Application tried to present modally an active controller

ぐ巨炮叔叔 提交于 2020-01-10 04:34:07
问题 I have searched for and found various q/a on this error, but have not been able to find any specific help for my issue (at least that my minimal experience allows me to understand). I am loading a UIView from the app's main menu, which in turn has several button options (call it submenu). One of these goes back to the main menu without issue ( [self dismissModalViewControllerAnimated:YES]; ). Another button loads a UITableView (separate view controller), which loads fine. However, I want a

Detecting iPhone 5 and any iOS device below it

岁酱吖の 提交于 2020-01-10 04:04:40
问题 A question was asked on SO about the iPhone 4 user agent and the iOS 5.0 user agent. I use the following to detect different mobile devices, viewport and screen. I'd like to be able to distinguish between the iPhone 5 and all other iOS devices. As far as I know, the line I'm using to detect the iOS 5.0 user agent var iPhone5 would also apply to any iOS device running iOS 5.0, so technically it's incorrect. var pixelRatio = window.devicePixelRatio || 1; var viewport = { width: window

How to make a uitableview in interface builder compatible with a 4 inch iPhone

与世无争的帅哥 提交于 2020-01-09 09:37:21
问题 How do I make a uitableview in interface builder compatible with 4 inch iphone5, and the older iPhone 4/4s? There are three options in Xcode 4.5: Freeform Retina 3.5 full screen Retina 4 full screen If I chose Retina 4, then in the 3.5 inch phone it crosses/overflows the screen border Using code, I can set the frame accordingly, but then what is the use of using interface builder? How should one do it using Interface Builder? EDIT My question is for iphone 5 retina 4 inch screen. When