Cell.textLabel.textAlignment = Uitextalignmentcenter;
Now we're going to write the cell. Textlabel. TextAlignment =nstextalignmentcenter;
UITableViewCell *cell = [[[UITableViewCell alloc] Initwithframe:cgrectzero Reuseidentifier:nil] autorelease];
Need to write
Static nsstring *tablesampleidentifier =@ "Tablesampleidentifier";
UITableViewCell *cell = [[UITableViewCellalloc] Initwithstyle:UITableViewCellStyleValue1reuseidentifier: tablesampleidentifier];
[self presentmodalviewcontroller: CalendarViewanimated: YES ];
change to [self presentviewcontroller: CalendarViewanimated:YES completion: ^{}];
The difference between the new interface is that it provides a parameter that allows you to pass in a block. This block 's callback method is called after the VC 's viewwilldisappear method. That is, the hidden VC object is freed after the callback is run.
The benefit of doing so is that it makes it easy to make connections and transitions between multiple UI effects.
The Pagecontrol control in IOS7
call [self. Subviewsobjectatindex: i]
Not Uiimageview, but UIView.
So the Updatedots method should be written like this:
-(void) updatedots{for (int i = 0; i < [self.subviews count]; i++) { uiview* dotview = [Self.subviews objectat INDEX: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 ]]
Should be written 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]; }