ios7

Apply Custom font to Attributed string Which Converts from HTML String

喜夏-厌秋 提交于 2019-12-17 11:45:50
问题 I used UITextView in which i display NSAttributedString . i got HTML string from server . I converted HTML to NSAttributedString using below code. NSMutableAttributedString *attrib = [[NSMutableAttributedString alloc]initWithData:[strHTML dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)} documentAttributes:nil error:nil]; To Apply font i tried below 2 codes. apply Attribute

iOS7 - receipts not validating at sandbox - error 21002 (java.lang.IllegalArgumentException)

半城伤御伤魂 提交于 2019-12-17 10:47:30
问题 I'm converting an app from iOS6 to iOS7. Before I used the deprecated transactionReceipt method so now I'm trying the recommended methods to retrieve the receipt, and then encode in base 64: NSData *working = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]]; // Tried 64 or 76 chars/line and LF or CR line endings NSString *receipt = [working base64EncodedStringWithOptions:kNilOptions]; The above is the only change in the code. Below is how I validate it, no changes:

iOS7 when UIsearchbar added in UINavigationBar not showing cancel button

我只是一个虾纸丫 提交于 2019-12-17 10:44:52
问题 I add UISearchBar above UINavigationBar and set UIsearchbar showsCancelButton YES, work fine in iOS6 but in iOS7 not showing cancel button. I used below code snippet UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 600, 44)]; searchBar.showsCancelButton = YES; searchBar.translucent = NO; [searchBar setTintColor:[UIColor redColor]]; searchBar.backgroundColor = [UIColor yellowColor]; [self.navigationController.navigationBar addSubview:searchBar]; 回答1: For some reason

MFMailComposeViewController in iOS 7 statusbar are black

删除回忆录丶 提交于 2019-12-17 10:35:09
问题 i have a feedback button in my ios 7 application with MFMailComposeViewController. After the user click this button the mailcomposer open but the statusbar changed to black. Have anybody a idea what can i do? i have this problem only with ios7. i customizing my app for ios7. MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init]; mailController.mailComposeDelegate = self; [mailController setSubject:@"Feedback"]; // Fill out the email body tex NSString

Div element won't stay at the bottom when ios 7 virtual keyboard is present

陌路散爱 提交于 2019-12-17 10:11:33
问题 I'm having a problem with a div element to stick to the bottom of my web app when ios 7 virtual keyboard appears after pressing a textbox. I've this div element: .... <div id="footer" style="text-align:center"> <div id="idName"><img alt="SomeName" src="images/logo.png" /></div> </div> </form> </body> It uses this style #footer{ color:#CCC; height: 48px; position:fixed; z-index:5; bottom:0px; width:100%; padding-left:2px; padding-right:2px; padding:0; border-top:1px solid #444; background:#222

MKPolygon area calculation

霸气de小男生 提交于 2019-12-17 09:49:43
问题 I'm trying to make an area calculation category for MKPolygon. I found some JS code https://github.com/mapbox/geojson-area/blob/master/index.js#L1 with a link to the algorithm: http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409. It says: Here is my code, which gave a wrong result (thousands times more than actual): #define kEarthRadius 6378137 @implementation MKPolygon (AreaCalculation) - (double) area { double area = 0; NSArray *coords = [self coordinates]; if (coords.count > 2) {

Autocomplete requires you to click twice in iOS after update to 1.11.0

北城余情 提交于 2019-12-17 08:46:12
问题 Using jQuery 2.1.0 and jQuery.ui 1.11.0 Tested in iOS 7. iPhone and iPad Mini. Works on android and regular browsers. The problem We recently upgraded from jQuery UI 1.10.0 to 1.11.0 and now, when clicking an item in an autocomplete results list, you only get a hover, you have to click the same element again to get a click event. This used to work fine with version 1.10.0. (JSFiddle link in comments) What does not work using css {cursor: pointer} does not work using onclick="" does not work

Autocomplete requires you to click twice in iOS after update to 1.11.0

假装没事ソ 提交于 2019-12-17 08:46:08
问题 Using jQuery 2.1.0 and jQuery.ui 1.11.0 Tested in iOS 7. iPhone and iPad Mini. Works on android and regular browsers. The problem We recently upgraded from jQuery UI 1.10.0 to 1.11.0 and now, when clicking an item in an autocomplete results list, you only get a hover, you have to click the same element again to get a click event. This used to work fine with version 1.10.0. (JSFiddle link in comments) What does not work using css {cursor: pointer} does not work using onclick="" does not work

UIBarButtonItem with custom view not properly aligned on iOS 7 when used as left or right navigation bar items

不羁的心 提交于 2019-12-17 08:02:42
问题 The following code works up through iOS 6: UIButton *myButton = nil; myButton = [UIButton buttonWithType:UIButtonTypeCustom]; myButton.bounds = CGRectMake(0,0,44,30); // setup myButton's images, etc. UIBarButtonItem *item = nil; item = [[UIBarButtonItem alloc] initWithCustomView:customButton]; This is how the button is supposed to be aligned: However, on iOS 7, the button appears to be offset from the right or left by too many pixels: How can I get my custom bar button items to be aligned

Why does my MCSession peer disconnect randomly?

萝らか妹 提交于 2019-12-17 07:05:59
问题 Im using MCNearbyServiceBrowser and MCNearbyServiceAdvertiser to join two peers to a MCSession. I am able to send data between them using MCSession's sendData method. All seems to be working as expected until I randomly (and not due to any event I control) receive a MCSessionStateNotConnected via the session's MCSessionDelegate didChangeState handler. Additionally, the MCSession's connectedPeers array no longer has my peers. Two questions: Why? and How do i keep the MCSession from