Cell. textLabel. textAlignment = UITextAlignmentCenter;
Now we need to write cell. textLabel. textAlignment = NSTextAlignmentCenter;
UITableViewCell * cell = [[UITableViewCell alloc] initWithFrame: CGRectZero reuseIdentifier: nil] autorelease];
To be written
Static NSString * TableSampleIdentifier = @ "TableSampleIdentifier ";
UITableViewCell * cell = [[UITableViewCellalloc] initWithStyle: UITableViewCellStyleValue1reuseIdentifier: TableSampleIdentifier];
[SelfpresentModalViewController: calendarViewanimated: YES];
Change to [selfpresentViewController: calendarViewanimated: YEScompletion: ^ {}];
The difference between the new interface is that it provides a parameter that allows you to input a block. The callback method of this block is called after the viewWillDisappear method of VC. That is, run the callback after the hidden VC object is released.
Benefits of doing so: it facilitates the convergence and conversion between multiple UI effects.
PageControl control on IOS7
Call [self. subviewsobjectAtIndex: I]
The retrieved object is not a UIImageView, but a UIView.
Therefore, the updateDots method should be written as follows:
-(void) updateDots{ for (int i = 0; i < [self.subviews count]; i++) { UIView* dotView = [self.subviews objectAtIndex:i]; if ([dotView isKindOfClass:[UIImageView class]]) { UIImageView* dot = (UIImageView*)dotView; if (i == self.currentPage) dot.image = _activeImage; else dot.image = _inactiveImage; }else{ if (i == self.currentPage) [dotView setBackgroundColor:[UIColor colorWithPatternImage:_activeImage]]; else [dotView setBackgroundColor:[UIColor colorWithPatternImage:_inactiveImage]]; } }}
[Text drawAtPoint: textPt withFont: [UIFontsystemFontOfSize: 14.0f]
Write in IOS7
#define NLSystemVersionGreaterOrEqualThan(version) ([[[UIDevice currentDevice] systemVersion] floatValue] >= version) #define IOS7_OR_LATER NLSystemVersionGreaterOrEqualThan(7.0) if (IOS7_OR_LATER) { UIFont* font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; font = [font fontWithSize:14.0f]; [text drawAtPoint:textPt withAttributes:@{NSFontAttributeName:font}]; }else { [text drawAtPoint:textPt withFont:[UIFont systemFontOfSize:14.0f]]; }