ios7

prevent ios7 pan gesture to pop view controller

烈酒焚心 提交于 2020-01-03 03:29:08
问题 iOS 7 has introduced pan gesture to popViewController. It introductes problems with the sidebar that I am using so I want to prevent this new function of ios7. How can I cancel that behaviour? Thanks in advance 回答1: You can use yourNavigationController.interactivePopGestureRecognizer.enabled = NO; 来源: https://stackoverflow.com/questions/18975060/prevent-ios7-pan-gesture-to-pop-view-controller

Location update in background and suspended app modes

喜夏-厌秋 提交于 2020-01-03 03:26:13
问题 I want to write application that every 5 min sends to server low-accuracy-location for its both modes: foreground and background. Because I don't want to reduce the battery charge and the locationSignificantChange gives only the high-accuracy-values, I start/stop locationUpdates from GPS every 5 min. Application works fine from foreground mode, but works only about 1 hour from background mode (and stops to send location afterwards). I guess I am missing something in backgroundTask/NSTimer

Add a sticky view underneath the Navigation Bar

我只是一个虾纸丫 提交于 2020-01-03 02:43:09
问题 I've seen a few other examples, but I haven't seen anything that actually sticks. What I want is essentially what a tableViewHeader does. I have a tableViewController with a navigation bar. I want to put a view into place that shows some search criteria in a small bar directly below the navbar. But I need it to stick when the user swipes to view the results. I've tried adding a UIView as a subview to the navigation bar, but it always sits at the top of the Navigation Bar, overlaying

Set NavigationBar Tint Color in iOS 7

大兔子大兔子 提交于 2020-01-03 02:31:12
问题 Am trying to set the tint for all navigation bars from my appdelegate in iOS 7. This worked always before, but for some reason now, nothing is changing. In the didFinishLaunching part of my appDelegate I have: [[UINavigationBar appearance] setTintColor:toolbarcolor]; However, the bar stays the default translucent option. 回答1: You can set the bar tint color using the barTintColor property: [[UINavigationBar appearance] setBarTintColor:[UIColor purpleColor]]; If you also don't want the

A specific StoryBoard for iOs 7 [duplicate]

旧巷老猫 提交于 2020-01-03 02:27:10
问题 This question already has an answer here : How to load multiple storyboard files depending on iOS version? (5 and 6) (1 answer) Closed 6 years ago . I'd like to optimize my app on iOs7 but this is really hard. Xcode looks pretty buggy... Do you know if it is possible to have 2 storyboards, one for iOs7 and the other for older versions ? Thanks a lot ! 回答1: Here's what you need to do. Put this type of logic in your applicationDidFinishLaunchingWithOptions: method of your app delegate: #define

How to get the default iOS browser name?

坚强是说给别人听的谎言 提交于 2020-01-02 23:21:00
问题 The Stack Overflow app detects the name of my jailbrokenly-set default browser (Chrome). How can I achieve the same thing in objective-c and swift? (Just the name, not the ActivityView code) Example: Update: I went into Settings > Stack Exchange and found this: It looks like the app defaults to Safari, but iff Chrome is installed then links will be sent to that browser. Chrome is most likely detected by the canOpenUrl method described in the answer below. 回答1: I suspect that the Stack

How to get valid base64 string for an image

橙三吉。 提交于 2020-01-02 23:02:13
问题 I use the following code to get a base64 encoded string of my image: UIImage *image = [photoView image]; NSString *encoded = [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; The image is 800*800 pixels, but the generated string is so big that it crashes my browser when I paste it in a textbox. I pasted it in dreamweaver to count the lines and it is over 300.000 lines. This can't be right. If I upload the same picture to this site it

In iOS 7, why UITableView's contentInset has bottom value despite the UITabBarController is hidden?

家住魔仙堡 提交于 2020-01-02 21:00:27
问题 I don't know why UITableView has bottom inset automatically despite I make UITabBarController be hidden by calling [setHidden:YES] before. The view controller who has UITableView is a child of UITabBarController . I already know that automaticallyAdjustsScrollViewInsets helps any UIScrollView get proper 'contentInset' depending on status of it's container view controller. So, I expected that UITableView 's bottom contentInset will be 0 if UITabBar is hidden. But, doesn't do that. Although

Using Constraints To Keep Two TableViews The Same Height & The Same Distance Apart

让人想犯罪 __ 提交于 2020-01-02 19:12:11
问题 Context / What I'd Like to Do I'm building this for iOS 7 I'm using a StoryBoard I have two UITableViews , that I'd like to keep the same height and distance apart, to retain visual consistency between 3.5 & 4 inch devices So on the shift from a 4 inch screen to 3.5 inch screen I'd like for: The table views to get shorter but remain equal in height For the top table view to keep the same y pos For the bottom table view to shift its y pos up to maintain the same distance between the bottom of

Weird behaviour of boundingRectWithSize:options:attributes:context:

本小妞迷上赌 提交于 2020-01-02 19:12:06
问题 I am experiencing a strange issue related to boundingRectWithSize:options:attributes:context: This is the code NSString *text = @"These long strings work"; CGSize maxSize = CGSizeMake(176.0f, MAXFLOAT); CGRect rect = [text boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:16.0]} context:nil]; CGSize size = rect.size; I have an xcode iOS project which uses this code. When I run the project, the size is (width