新浪微博开发之三十二(原创微博和转发微博frame)
来源:互联网 发布:mac鼠标滚轮没反应 编辑:程序博客网 时间:2024/06/12 19:27
// MyweiboDetailFrame.h
// 新浪微博
//
// Created by Jose on 15-4-20.
// Copyright (c) 2015年 jose. All rights reserved.
// 原创和转发微博的frame
#import <Foundation/Foundation.h>
#import "UIView+Extension.h"
@class MyWeiboModel,MyweiboOriginalFrame,MyweiboRetweetedFrame;
@interface MyweiboDetailFrame : NSObject
/** 原创微博的frame */
@property(nonatomic,strong)MyweiboOriginalFrame *originalframe;
/** 转发微博的frame */
@property(nonatomic,strong)MyweiboRetweetedFrame *retweetedframe;
/** 原创和转发微博的frame */
@property(nonatomic,assign)CGRect detailframe;
/** 传入微博的数据 */
@property(nonatomic,strong)MyWeiboModel *detailweibo;
@end
************************************************************************************************************
***********************************************************************************************************
***********************************************************************************************************
//
// MyweiboDetailFrame.m
// 新浪微博
//
// Created by Jose on 15-4-20.
// Copyright (c) 2015年 jose. All rights reserved.
//
#import "MyweiboDetailFrame.h"
#import "MyweiboOriginalFrame.h"
#import "MyweiboRetweetedFrame.h"
#import "MyWeiboModel.h"
#import "Global.h"
@implementation MyweiboDetailFrame
-(void)setDetailweibo:(MyWeiboModel *)detailweibo{
//全局变量
_detailweibo=detailweibo;
//1.计算原创微博的frame
MyweiboOriginalFrame *myweibooriginalframe=[[MyweiboOriginalFrame alloc]init];
//传入原创微博的数据
myweibooriginalframe.originalweibo=detailweibo;
self.originalframe=myweibooriginalframe;
//2.计算转发微博的frame
CGFloat h=0;
if(detailweibo.retweeted_status){
MyweiboRetweetedFrame *myweiboretweetedframe=[[MyweiboRetweetedFrame alloc]init];
//传入转发微博的数据
myweiboretweetedframe.retweetedweibo=detailweibo.retweeted_status;
//计算转发微博的y值
CGRect temp=myweiboretweetedframe.retweetedframe;
temp.origin.y=CGRectGetMaxY(self.originalframe.originalframe);
myweiboretweetedframe.retweetedframe=temp;
self.retweetedframe=myweiboretweetedframe;
//转发微博的frame
h=CGRectGetMaxY(myweiboretweetedframe.retweetedframe);
}
else{
//原创微博的frame
h=CGRectGetMaxY(myweibooriginalframe.originalframe);
}
//3,计算自己的frame
CGFloat x=0;
//添加cell的间隙,设置为10
CGFloat y=CellMargin;
CGFloat w=ScreenBounds.size.width;
self.detailframe=CGRectMake(x, y, w, h);
}
@end
- 新浪微博开发之三十二(原创微博和转发微博frame)
- 新浪微博开发之三十(转发微博frame)
- 新浪微博开发之二十八(原创微博frame)
- 新浪微博开发之三十五(微博frame)
- 新浪微博开支三十三(原创和转发微博view)
- 新浪微博开发之三十一(转发微博view)
- 新浪微博开发之二十九(原创微博view)
- (droid分享)新浪微博开发系列【十三】之微博的评论转发
- 新浪腾讯微博转发 js代码
- 35day 新浪微博(CELL转发)
- 新浪微博开发之php开发
- iOS开发之新浪微博登陆和分享
- IOS开发之新浪微博OAuth2
- 新浪微博数据挖掘食谱之九: 用户篇 (获取转发微博的用户名)
- 新浪微博数据挖掘食谱之十: 元素篇 (提取转发微博的元素)
- C#正则式提取新浪微博转发地址
- 转发到新浪微博QQ腾迅微博代码
- Apache 转发获取新浪微博https数据
- 2.2 分治法的基本思想
- 线性表的链式存储(单链表)的基本操作
- LightOJ1151---Snakes and Ladders (高斯消元+概率dp)
- 快速理解Linux多线程及Epoll
- 1384
- 新浪微博开发之三十二(原创微博和转发微博frame)
- acitvator 将play工程导入eclipse
- Fiddler教程
- 东大OJ-1544: GG的战争法则
- 产生组合数,位运算
- sss
- iOS 倒计时 方法
- 新浪微博开支三十三(原创和转发微博view)
- vim的简明教程