|
UIView *tmpView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetMaxX(self.tableView.bounds), 265)]; |
|
|
|
NSString *lbl = L(addPhoto); |
|
CGFloat labelwidth = [lbl sizeWithFont:kAddPhotoBtnFont].width; |
|
|
|
FormButtonElement *addPhotoBtn = [[FormButtonElement alloc] initWithFrame:CGRectMake(kLeftRightPadding, 0, labelwidth+kLeftRightPadding*4, 30)]; |
|
|
|
[addPhotoBtn setTitle:L(addPhoto) forState:UIControlStateNormal]; |
|
addPhotoBtn.titleLabel.font = kAddPhotoBtnFont; |
|
|
|
//Resize background image according to the string |
|
UIImage *button = [[UIImage imageNamed:@"addPhoto.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0.0, 20.0, 30.0, 20.0)]; |
|
|
|
[addPhotoBtn setButtonImageStyle:button]; |
|
addPhotoBtn.titleEdgeInsets = UIEdgeInsetsMake(0.0, 20.0, 0.0, 0.0); |
|
[addPhotoBtn addTarget:self action:@selector(addPhotoBtnClicked:) forControlEvents:UIControlEventTouchUpInside]; |
|
|
|
[tmpView addSubview:addPhotoBtn]; |
|
|
|
imageNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(addPhotoBtn.frame.size.width + 20, 0, CGRectGetMaxX(self.tableView.bounds), 30)]; |
|
[imageNumberLabel setBackgroundColor:[UIColor clearColor]]; |
|
imageNumberLabel.textColor = kCellTextLabelColorNormal; |
|
[tmpView addSubview:imageNumberLabel]; |
|
|
|
UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(kLeftRightPadding, addPhotoBtn.frame.size.height, CGRectGetMaxX(self.tableView.bounds), 40)]; |
|
[descriptionLabel setText:L(description)]; |
|
[descriptionLabel setBackgroundColor:[UIColor clearColor]]; |
|
descriptionLabel.textColor = kCellTextLabelColorNormal; |
|
descriptionLabel.font = kDescriptionLabel; |
|
|
|
[tmpView addSubview:descriptionLabel]; |