IOS-Purchase type view
Custom purchase type view
Code
// Payment page format-(UIView *) CellForRowAtRow :( NSInteger) row {UIView * itemView = [UIView viewWithFrame: CGRectMake (0, 0, viewWidth ()-20, 45) andBkColor: [UIColor clearColor]; NIDASSERT (row <_ alipayInfo. count); if (row <_ alipayInfo. count) {// member subscription UILabel * titleLabel = [UILabel labelWithFrame: CGRectMake (10, 15,100, 15) fontSize: 14 fontColor: RGBCOLOR_HEX (0x666666) text: _ alipayInfo [row] [@ desc]; [itemView addSubview: titleLabel]; // price CYAttributedLabel * pricelabel = [[CYAttributedLabel alloc] initWithFrame: CGRectMake (0, 12,125, 20)]; pricelabel. verticalTextAlignment = NIVerticalTextAlignmentTop; pricelabel. text = [NSString stringWithFormat: @ % @ yuan, _ alipayInfo [row] [@ price]; pricelabel. font = [UIFont boldSystemFontOfSize: 14]; pricelabel. textColor = RGBCOLOR_HEX (0xff6000); [pricelabel setFont: [UIFont boldSystemFontOfSize: 11] range: [pricelabel. text rangeOfString: @ yuan]; pricelabel. textAlignment = values; [itemView addSubview: pricelabel]; // compare CYAttributedLabel * values = [[CYAttributedLabel alloc] initWithFrame: CGRectMake (145, 16,110, 18. font = [UIFont systemFontOfSize: 11]; originPriceLabel. verticalTextAlignment = NIVerticalTextAlignmentTop; originPriceLabel.css Handler = [CYResource getCssHandler]; originPriceLabel. text = _ alipayInfo [row] [@ old_price]; originPriceLabel. textColor = RGBCOLOR_HEX (0x666666); [itemView addSubview: originPriceLabel]; NSArray * array = [originPriceLabel. text componentsSeparatedByString: @]; // underlined UIView * lineView = [[UIView alloc] init]; lineView. backgroundColor = originPriceLabel. textColor; [itemView addSubview: lineView]; UILabel * subLabel = [UILabel labelWithFrame: CGRectZero fontSize: 14 fontColor: [UIColor blackColor] text: array [0]; [subLabel finished]; lineView. frame = CGRectMake (originPriceLabel. left, originPriceLabel. top + 7, subLabel. width-10, 1); // The selected button UIButton * button = [UIButton buttonWithBackgroundImage: Custom selectedBackgroundImage: custom frame: CGRectMake (viewWidth ()-50, 14, 20, 20) target: nil selector: nil]; [itemView addSubview: button];} return itemView ;}
Effect