新浪微博开发之三十六(微博view)

//
//  MyweiboTableViewCell.h
//  新浪微博
//
//  Created by Jose on 15-4-21.
//  Copyright (c) 2015年 jose. All rights reserved.
//


#import <UIKit/UIKit.h>
@class MyweiboFrame;


@interface MyweiboTableViewCell : UITableViewCell
/** 微博frame */
@property(nonatomic,strong)MyweiboFrame *weiboframe;
/** 初始化微博cell */
+(instancetype)CellWithTabelView:(UITableView *)tableview;

@end




*********************************************************************************************************************

*********************************************************************************************************************

*********************************************************************************************************************
//
//  MyweiboTableViewCell.m
//  新浪微博
//
//  Created by Jose on 15-4-21.
//  Copyright (c) 2015年 jose. All rights reserved.
//


#import "MyweiboTableViewCell.h"
#import "MyweiboDetailView.h"
#import "MyweiboToolBarView.h"
#import "MyweiboFrame.h"


@interface MyweiboTableViewCell()
/** 原创和转发微博的view */
@property(nonatomic,weak)MyweiboDetailView *detailview;
/** 微博工具栏的view */
@property(nonatomic,weak)MyweiboToolBarView *toolbarview;
@end


@implementation MyweiboTableViewCell




//初始化cell
+(instancetype)CellWithTabelView:(UITableView *)tableview{
    static NSString *ID=@"weibocell";
    MyweiboTableViewCell *cell=[tableview dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell=[[MyweiboTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    //清空cell的背景色
    cell.backgroundColor=[UIColor clearColor];
    return cell;
}




//初始化cell的子控件
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        //1.添加原创和转发微博的view
        MyweiboDetailView *detailview=[[MyweiboDetailView alloc]init];
        [self.contentView addSubview:detailview];
        _detailview=detailview;
        
        //2.添加微博工具栏的view
        MyweiboToolBarView *toolbarview=[[MyweiboToolBarView alloc]init];
        [self.contentView addSubview:toolbarview];
        _toolbarview=toolbarview;
    }
    return self;
}


//传入微博frame
-(void)setWeiboframe:(MyweiboFrame *)weiboframe{
    _weiboframe=weiboframe;
    //原创和转发微博的frame
    _detailview.detailframe=weiboframe.detailframe;
    //微博工具栏的frame
    _toolbarview.frame=weiboframe.MyweiboToolBarFrame;
    //传入微博数据
    _toolbarview.weibo=weiboframe.weibo;
}


@end

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值