view代码5

头文件


#import


@interface GroupbuyingViewMaterial :NSObject


@property (retain,nonatomic)UIImageView * imageView_calculator;


@property (retain,nonatomic)UILabel     * label_groupbuing;


@end


实现文件


#import "GroupbuyingViewMaterial.h"


#define FONT(s) [UIFont fontWithName:@"HelveticaNeue" size:s]

#define BOLDFONT(s) [UIFont fontWithName:@"HelveticaNeue-Bold" size:s]


@implementation GroupbuyingViewMaterial


- (id)init

{

   self = [superinit];

   if (self) {

        //1.        //navigationBar的视图

       NSString * imageView_calculatorPath = [[NSBundlemainBundle]pathForResource:@"calculator-start@2x"ofType:@"png"];

       UIImage * imageView_calculatorImage = [UIImageimageWithContentsOfFile:imageView_calculatorPath];

        self.imageView_calculator = [[[UIImageViewalloc]init]autorelease];

       self.imageView_calculator.image = imageView_calculatorImage;

        self.imageView_calculator.frame=CGRectMake(0, 0, 320, 44);

        

        //2.        //navigationBar上面的城市显示

        self.label_groupbuing = [[[UILabelalloc] init]autorelease];

        self.label_groupbuing.frame=CGRectMake(50, 0, 220, 44);

        self.label_groupbuing.text =@"无锡·本期团购";

        self.label_groupbuing.font =FONT(20);

        self.label_groupbuing.backgroundColor = [UIColorclearColor];

        self.label_groupbuing.textAlignment=NSTextAlignmentCenter;

        self.label_groupbuing.textColor=[UIColorwhiteColor];

        [self.imageView_calculatoraddSubview:self.label_groupbuing];

        

    }

    return self;

}


- (void)dealloc

{

    self.imageView_calculator =nil;

    self.label_groupbuing =nil;

    [superdealloc];

}

@end



你可能感兴趣的:(IOS)