首页-- EliteSchoolTableViewCell
#import
@interface EliteSchoolTableViewCell : UITableViewCell
@end
#import "EliteSchoolTableViewCell.h"
@implementationEliteSchoolTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
{
self= [superinitWithStyle:stylereuseIdentifier:reuseIdentifier];
if(self) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
UIScreen* mainScreen = [UIScreenmainScreen];
CGFloatwidth = mainScreen.bounds.size.width/4;
CGFloatheight =70;
UIImage* eliteScloolImage = [UIImageimageNamed:@""];
UIButton* eliteScloolBtn = [[UIButtonalloc]initWithFrame:CGRectMake(width*0,10, width, height)];
[eliteScloolBtnsetImage:eliteScloolImageforState:UIControlStateNormal];
[eliteScloolBtnaddTarget:self action:@selector(showEliteSchoolAction:) forControlEvents:UIControlEventTouchUpInside];
[self.contentViewaddSubview:eliteScloolBtn];
CGRecteliteSchoolLabelFrame =CGRectMake(0,CGRectGetHeight(eliteScloolBtn.frame), width,15);
UILabel* eliteSchoolLabel = [[UILabelalloc]initWithFrame:eliteSchoolLabelFrame];
eliteSchoolLabel.textColor= [UIColorlightGrayColor];
eliteSchoolLabel.textAlignment=NSTextAlignmentCenter;
eliteSchoolLabel.font= [UIFontsystemFontOfSize:12];
eliteSchoolLabel.text=@"第一中学";
eliteSchoolLabel.numberOfLines=0;
[eliteScloolBtnaddSubview:eliteSchoolLabel];
}
return self;
}
- (void)showEliteSchoolAction:(UIButton*)btn
{
NSLog(@"名校风采");
}
@end