Purchase type View customization
Code
//Payment page format- (UIView*) Cellforrowatrow: (Nsinteger) Row {UIView* Itemview = [UIViewViewwithframe:cgrectmake (0,0, Viewwidth ()- -, $) Andbkcolor: [UicolorClearcolor]]; Nidassert (Row < _alipayinfo. Count);if(Row < _alipayinfo. Count) {//Membership Package annual subscription UILabel* Titlelabel = [UILabelLabelwithframe:cgrectmake (Ten, the, -, the) FontSize: -Fontcolor:rgbcolor_hex (0x666666) Text: _alipayinfo[row][@"desc"]]; [Itemview Addsubview:titlelabel];//Pricecyattributedlabel* Pricelabel = [[Cyattributedlabel alloc] Initwithframe:cgrectmake (0, A, the, -)]; Pricelabel. Verticaltextalignment= Niverticaltextalignmenttop; Pricelabel. Text= [NSStringstringWithFormat: @"%@ yuan", _alipayinfo[row][@"Price"]]; Pricelabel. Font= [UifontBoldsystemfontofsize: -]; Pricelabel. TextColor= Rgbcolor_hex (0xff6000); [Pricelabel SetFont: [UifontBoldsystemfontofsize: One] Range: [Pricelabel. TextRangeofstring: @"Yuan"]]; Pricelabel. TextAlignment= Nstextalignmentright; [Itemview Addsubview:pricelabel];//And comparison of the original pricecyattributedlabel* Originpricelabel = [[Cyattributedlabel alloc] Initwithframe:cgrectmake (145, -, the, -)]; Originpricelabel. Font= [UifontSystemfontofsize: One]; Originpricelabel. Verticaltextalignment= Niverticaltextalignmenttop; Originpricelabel. Csshandler= [Cyresource Getcsshandler]; Originpricelabel. Text= _alipayinfo[row][@"Old_price"]; Originpricelabel. TextColor= Rgbcolor_hex (0x666666); [Itemview Addsubview:originpricelabel];Nsarray*array = [Originpricelabel. Textcomponentsseparatedbystring:@" "];//Dash UIView*lineview = [[UIViewALLOC] init]; Lineview. BackgroundColor= Originpricelabel. TextColor; [Itemview Addsubview:lineview];UILabel*sublabel = [UILabelLabelwithframe:cgrectzero fontSize: -fontcolor:[UicolorBlackcolor] text:array[0]]; [Sublabel SizeToFit]; Lineview. Frame= CGRectMake (Originpricelabel. Left, Originpricelabel. Top+7, Sublabel. Width-Ten,1);//The selected button UIButton* button = [UIButtonButtonwithbackgroundimage: @"Choose_icon_normal.png"Selectedbackgroundimage: @"Choose_icon_selected.png"Frame:cgrectmake (Viewwidth ()- -, -, -, -) Target:NilSelectorNil]; [Itemview Addsubview:button]; }returnItemview;}
Effect
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
IOS-Purchase Type View