View代码1

头文件


#import <Foundation/Foundation.h>


@interface LoupanViewMaterial :NSObject


@property (retain,nonatomic)UIImageView             * imageView_calculator;


@property (retain,nonatomic)UILabel                 * label_city;


@property (retain,nonatomic)UIButton                * button_nearby;


@property (retain,nonatomic)UIButton                * button_region;


@property (retain,nonatomic)UIButton                * button_map;


@property (retain,nonatomic)UIView                  * view_header;


@property (retain,nonatomic)UIView                  * view_footer;


@property (retain,nonatomic)UIActivityIndicatorView * activity;


@property (retain,nonatomic)UILabel                 * label_loupan_more;

@end



实现文件



#import "LoupanViewMaterial.h"


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

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


@implementation LoupanViewMaterial


- (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_city = [[[UILabelalloc]init]autorelease];

       self.label_city.frame=CGRectMake(5, 0, 50, 44);

       self.label_city.text =@"无锡";

       self.label_city.font =FONT(16);

        self.label_city.backgroundColor = [UIColorclearColor];

        self.label_city.textAlignment=NSTextAlignmentCenter;

        self.label_city.textColor=[UIColorwhiteColor];

        [self.imageView_calculatoraddSubview:self.label_city];

        

//3.  //上面的箭头

        NSString * jiantouDownPath = [[NSBundlemainBundle]pathForResource:@"daqo_arrow_20130315@2x"ofType:@"png"];

       UIImage * jiantouDownImage = [UIImageimageWithContentsOfFile:jiantouDownPath];

       UIImageView * jiantouDownImageView = [[UIImageViewalloc]init];

        jiantouDownImageView.image = jiantouDownImage;

        jiantouDownImageView.frame =CGRectMake(60, 18, 12, 8);

        [self.imageView_calculatoraddSubview:jiantouDownImageView];

        [jiantouDownImageViewrelease];

        

//4.    //上面的分割线

        NSString * linePath = [[NSBundlemainBundle]pathForResource:@"daqo_line2_20130315@2x"ofType:@"png"];

        UIImage * lineImage = [UIImageimageWithContentsOfFile:linePath];

       UIImageView * lineImageView = [[UIImageViewalloc]init];

        lineImageView.image = lineImage;

        lineImageView.frame =CGRectMake(80, 0, 1, 44);

        [self.imageView_calculatoraddSubview:lineImageView];

        [lineImageViewrelease];

        

//5.     //搜索框

        NSString * searchBarPath = [[NSBundlemainBundle]pathForResource:@"searchbar_20121129@2x"ofType:@"png"];

       UIImage * searchBarImage = [UIImageimageWithContentsOfFile:searchBarPath];

       UIImageView * searchBarImageView = [[UIImageViewalloc]init];

        searchBarImageView.image=searchBarImage;

        searchBarImageView.frame=CGRectMake(88, 7, 224, 30);

        [self.imageView_calculatoraddSubview:searchBarImageView];

        [searchBarImageViewrelease];


//6.    //搜索框内的文本显示

       UILabel * searchBarLabel = [[UILabelalloc]init];

        searchBarLabel.frame =CGRectMake(10, 0, 220, 30);

        searchBarLabel.text =@"请输入楼盘名或楼盘地址...";

        searchBarLabel.textColor = [UIColorgrayColor];

        searchBarLabel.font =FONT(15);

        searchBarLabel.textAlignment =NSTextAlignmentLeft;

        searchBarLabel.backgroundColor = [UIColorclearColor];

        [searchBarImageViewaddSubview:searchBarLabel];

        [searchBarLabelrelease];

        

//7.    //搜索框内的图标

        NSString * searchBarIconPath = [[NSBundlemainBundle]pathForResource:@"aifang_90@2x"ofType:@"png"];

       UIImage * searchBarIconImage = [UIImageimageWithContentsOfFile:searchBarIconPath];

       UIImageView * searchBarIconImageView = [[UIImageViewalloc]init];

        searchBarIconImageView.image=searchBarIconImage;

        searchBarIconImageView.frame=CGRectMake(198, 6, 18, 18);

        [searchBarImageViewaddSubview:searchBarIconImageView];

        [searchBarIconImageViewrelease];

        

//*****************************************************************************************************************************************


//8.   tableView headerView;

        self.view_header = [[[UIViewalloc]init]autorelease];

       self.view_header.frame =CGRectMake(0, 0, 320, 230);

        self.view_header.backgroundColor = [UIColorwhiteColor];


//9.  附近找房的button

        

        NSString * button_nearbyPath = [[NSBundlemainBundle]pathForResource:@"footprint_nearby@2x"ofType:@"png"];

       UIImage * button_nearbyImage = [UIImageimageWithContentsOfFile:button_nearbyPath];

        //等同于UIImage * button_nearbyImage = [UIImage imageNamed:@"footprint_nearby@2x.png"];

        self.button_nearby = [UIButtonbuttonWithType:UIButtonTypeCustom];

       self.button_nearby.frame =CGRectMake(10, 10, 300, 56);

       self.button_nearby.tag = 81;

        [self.button_nearbysetBackgroundImage:button_nearbyImageforState:UIControlStateNormal];

       NSString * button_press_nearbyPath = [[NSBundlemainBundle]pathForResource:@"footprint_press_nearby@2x"ofType:@"png"];

       UIImage * button_press_nearbyImage = [UIImageimageWithContentsOfFile:button_press_nearbyPath];

        self.button_nearby.adjustsImageWhenHighlighted =NO;

        [self.button_nearbysetBackgroundImage:button_press_nearbyImageforState:UIControlStateHighlighted];

        

        //上面label的文字显示

       UILabel *nearbyLabel1 = [[UILabelalloc]init];

        nearbyLabel1.frame =CGRectMake(65, 5, 200, 26);

        nearbyLabel1.text =@"附近找房";

        nearbyLabel1.textAlignment =NSTextAlignmentLeft;

        nearbyLabel1.backgroundColor = [UIColorclearColor];

        nearbyLabel1.font =FONT(16);

        [self.button_nearbyaddSubview:nearbyLabel1];

        [nearbyLabel1release];

        

       UILabel *nearbyLabel2 = [[UILabelalloc]init];

        nearbyLabel2.frame =CGRectMake(65, 31, 200, 20);

        nearbyLabel2.text =@"快速查找附近新盘";

        nearbyLabel2.textAlignment =NSTextAlignmentLeft;

        nearbyLabel2.backgroundColor = [UIColorclearColor];

        nearbyLabel2.textColor = [UIColorgrayColor];

        nearbyLabel2.font =FONT(12);

        [self.button_nearbyaddSubview:nearbyLabel2];

        [nearbyLabel2release];

        

        [self.view_headeraddSubview:self.button_nearby];

        

        

//10. 区域找房

        NSString * button_regionPath = [[NSBundlemainBundle]pathForResource:@"footprint_region@2x"ofType:@"png"];

       UIImage * button_regionImage = [UIImageimageWithContentsOfFile:button_regionPath];

        self.button_region = [UIButtonbuttonWithType:UIButtonTypeCustom];

       self.button_region.frame =CGRectMake(10, 76, 300, 56);

       self.button_region.tag = 82;

        [self.button_regionsetBackgroundImage:button_regionImageforState:UIControlStateNormal];

        //设置点击高亮时的图片显示

       NSString * button_press_regionPath = [[NSBundlemainBundle]pathForResource:@"footprint_press_region@2x"ofType:@"png"];

       UIImage * button_press_regionImage = [UIImageimageWithContentsOfFile:button_press_regionPath];

        self.button_region.adjustsImageWhenHighlighted =NO;

        [self.button_regionsetBackgroundImage:button_press_regionImageforState:UIControlStateHighlighted];

        

        //上面label的文字显示

       UILabel *regionLabel1 = [[UILabelalloc]init];

        regionLabel1.frame =CGRectMake(65, 5, 200, 26);

        regionLabel1.text =@"区域找房";

        regionLabel1.textAlignment =NSTextAlignmentLeft;

        regionLabel1.backgroundColor = [UIColorclearColor];

        regionLabel1.font =FONT(16);

        [self.button_regionaddSubview:regionLabel1];

        [regionLabel1release];

        

       UILabel *regionLabel2 = [[UILabelalloc]init];

        regionLabel2.frame =CGRectMake(65, 31, 200, 20);

        regionLabel2.text =@"根据区域、价格、特色筛选";

        regionLabel2.textAlignment =NSTextAlignmentLeft;

        regionLabel2.backgroundColor = [UIColorclearColor];

        regionLabel2.textColor = [UIColorgrayColor];

        regionLabel2.font =FONT(12);

        [self.button_regionaddSubview:regionLabel2];

        [regionLabel2release];

        

        [self.view_headeraddSubview:self.button_region];

//11. 地图找房

        NSString * button_mapPath = [[NSBundlemainBundle]pathForResource:@"footprint_map@2x"ofType:@"png"];

       UIImage * button_mapImage = [UIImageimageWithContentsOfFile:button_mapPath];

        self.button_map = [UIButtonbuttonWithType:UIButtonTypeCustom];

       self.button_map.frame =CGRectMake(10, 142, 300, 56);

       self.button_map.tag = 83;

        [self.button_mapsetBackgroundImage:button_mapImageforState:UIControlStateNormal];

        //设置点击高亮时的图片显示

        NSString * button_press_mapPath = [[NSBundlemainBundle]pathForResource:@"footprint_press_map@2x"ofType:@"png"];

       UIImage * button_press_mapImage = [UIImageimageWithContentsOfFile:button_press_mapPath];

        self.button_map.adjustsImageWhenHighlighted =NO;

        [self.button_mapsetBackgroundImage:button_press_mapImageforState:UIControlStateHighlighted];

        

        //上面label的文字显示

       UILabel *mapLabel1 = [[UILabelalloc]init];

        mapLabel1.frame =CGRectMake(65, 5, 200, 26);

        mapLabel1.text =@"地图找房";

        mapLabel1.textAlignment =NSTextAlignmentLeft;

        mapLabel1.backgroundColor = [UIColorclearColor];

        mapLabel1.font =FONT(16);

        [self.button_mapaddSubview:mapLabel1];

        [mapLabel1release];

        

       UILabel *mapLabel2 = [[UILabelalloc]init];

        mapLabel2.frame =CGRectMake(65, 31, 200, 20);

        mapLabel2.text =@"按照地图显示查找楼盘";

        mapLabel2.textAlignment =NSTextAlignmentLeft;

        mapLabel2.backgroundColor = [UIColorclearColor];

        mapLabel2.textColor = [UIColorgrayColor];

        mapLabel2.font =FONT(12);

        [self.button_mapaddSubview:mapLabel2];

        [mapLabel2release];


        [self.view_headeraddSubview:self.button_map];

        

//   //热门新盘的label显示

       UILabel *xinpanLabel = [[UILabelalloc]init];

        xinpanLabel.frame =CGRectMake(10, 205, 100, 25);

        xinpanLabel.text =@"热门新盘";

        xinpanLabel.textAlignment =NSTextAlignmentLeft;

        xinpanLabel.backgroundColor = [UIColorclearColor];

        xinpanLabel.font =FONT(14);

        [self.view_headeraddSubview:xinpanLabel];

        [xinpanLabelrelease];

        

       //下方线的显示

       UIView * xinpanLine = [[UIViewalloc]init];

        xinpanLine.frame =CGRectMake(0, 229, 320, 1);

        xinpanLine.backgroundColor = [UIColorgrayColor];

        [self.view_headeraddSubview:xinpanLine];

        [xinpanLinerelease];

        

//********************************************************************footView*********************************************************************

        self.view_footer = [[[UIViewalloc]init]autorelease];

       self.view_footer.frame =CGRectMake(0, 0, 320, 50);

       //菊花

        self.activity = [[[UIActivityIndicatorViewalloc]init]autorelease];

       self.activity.frame =CGRectMake(65, 0, 35, 50);

        self.activity.activityIndicatorViewStyle =UIActivityIndicatorViewStyleGray;

        self.activity.hidesWhenStopped =YES;

        self.activity.backgroundColor = [UIColorclearColor];

        [self.view_footeraddSubview:self.activity];

       //楼盘更多显示

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

        self.label_loupan_more.frame =CGRectMake(100, 0, 150, 50);

        self.label_loupan_more.backgroundColor = [UIColorclearColor];

        self.label_loupan_more.textAlignment =NSTextAlignmentLeft;

        self.label_loupan_more.textColor = [UIColorbrownColor];

        self.label_loupan_more.font =FONT(15);

        [self.view_footeraddSubview:self.label_loupan_more];

        

    }

    return self;

}


- (void)dealloc

{

    self.label_loupan_more    =nil;

   self.activity             =nil;

   self.view_footer          =nil;

   self.view_header          =nil;

   self.button_map           =nil;

   self.button_region        =nil;

   self.button_nearby        =nil;

    self.imageView_calculator =nil;

   self.label_city           =nil;

    [superdealloc];

}

@end



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值