ios6

iOS 6 appearance when contained in multiple classes

久未见 提交于 2019-12-20 10:28:09
问题 I’m using the appearanceWhenContainedIn method on certain UI elements that I want to customise in my iOS 6 app. The problem I found is that none of my customisations are applied if I try to provide more than one container class, like so: // Works neither for toolbar nor navbar items [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], [UIToolbar class], nil] // Works fine (but only for navbar items, obviously) [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class],

Top-aligning text of different sizes within a UILabel

我怕爱的太早我们不能终老 提交于 2019-12-20 10:06:12
问题 How to top-align text of different sizes within a UILabel? An example is top-aligning smaller-sized cent amount with larger-sized dollar amount in price banners. UILabel in iOS6 supports NSAttributedString which allows me to have text of different sizes in the same UILabel. However it doesn't seem to have an attribute for top-aligning text. What are the options to implement this? It seems to me that providing a custom drawing logic to do top-alignment based on a custom attributed string key

Google Places API Violation

廉价感情. 提交于 2019-12-20 08:57:12
问题 I am using Google Places API to pull a list of resturants, and I am displaying them on map. However, since Apple has switched there map services over from Google in iOS 6.0, I am now in violation of Google's terms of use, which states that you must display Google data on a Google map. "If your application displays Places API data on a map, that map must be provided by Google." https://developers.google.com/places/policies#terms_of_use I obviously need to change the map, because I am not going

What to name images for iPhone 5 screen size?

ε祈祈猫儿з 提交于 2019-12-20 08:04:00
问题 What is the new naming convention for images for the 4-inch retina display? For an image named background.png you add @2x to the name ( background@2x.png ) to tell iOS to use that one for devices with the retina display. What would the suffix be for iPhone 5's screen size? 回答1: You can use my #define s to help you with these images: #define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568) #define

What to name images for iPhone 5 screen size?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 08:03:24
问题 What is the new naming convention for images for the 4-inch retina display? For an image named background.png you add @2x to the name ( background@2x.png ) to tell iOS to use that one for devices with the retina display. What would the suffix be for iPhone 5's screen size? 回答1: You can use my #define s to help you with these images: #define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568) #define

iPhone landscape issues

我怕爱的太早我们不能终老 提交于 2019-12-20 07:26:25
问题 xcode:4.5.2 I want to create an application in iPad; I settings my info.plist as below: Initial interface orientation: Landscape (left home button) When I started my app, the orientation device have landscape mode, but my view not rotate to this orienatation. I don't know what it is, who can help me 回答1: are you implements these following methods. -(BOOL)shouldAutomaticallyForwardAppearanceMethods{ // This method is called to determine whether to // automatically forward appearance-related

Replace <ol> & <li> tags from html code with number in iOS 6

放肆的年华 提交于 2019-12-20 06:27:05
问题 I am getting html code from server & I want to display it in UITextView. I need to parse the html & show plain text in UITextView. I am using below code to parse html from this post Now I need to replace the li tag with the actual numbers . How can I do that ? e.g. Input <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> Output should be Coffee Tea Milk 回答1: Replace you Function with following and pass your HTML string snippet that you have posted. NSString *str = @"<ol>" "<li>Coffee</li>"

MKMap works incorrect in iOs6

我的未来我决定 提交于 2019-12-20 06:20:45
问题 I have a problem: I have to know when map data are loaded to the Map view. I used the following method. - (void)mapViewDidFinishLoadingMap:(MKMapView *)mapView; { //Some custom code if Map is loaded } Apple changed Map and now the method is called but map is still loading. Do you have any ideas? 回答1: I've fixed it. At first, I created a function with my custom code -(void)customCode(id)object { MKMapView* mapView = (MKMapView *)object; ... } In the function mapViewDidFinishLoadingMap I set -

how to find nearest latitude and longitude form current place?

感情迁移 提交于 2019-12-20 06:07:27
问题 I have a dictionary with a collection of n number of latitude, longitude and address. I want to calculate which (latitude and langitude)point is closest from current user location(latitude ,langitude) in ios? Thanks in advance 回答1: If you want to calculate based on the co-ordinates , here is simple scenario : Just take all of the "CLLocationCoordinate2D" from your dictionary . For ex: MKPointAnnotation *annotaion=[MKPointAnnotaion alloc]alloc]; CLLocationCoordinate2D pointACoordinate =

how to find nearest latitude and longitude form current place?

倖福魔咒の 提交于 2019-12-20 06:06:04
问题 I have a dictionary with a collection of n number of latitude, longitude and address. I want to calculate which (latitude and langitude)point is closest from current user location(latitude ,langitude) in ios? Thanks in advance 回答1: If you want to calculate based on the co-ordinates , here is simple scenario : Just take all of the "CLLocationCoordinate2D" from your dictionary . For ex: MKPointAnnotation *annotaion=[MKPointAnnotaion alloc]alloc]; CLLocationCoordinate2D pointACoordinate =