新浪微博开发之三十(转发微博frame)
来源:互联网 发布:企业 java用什么软件 编辑:程序博客网 时间:2024/06/06 03:59
// MyweiboRetweetedFrame.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;
@interface MyweiboRetweetedFrame : NSObject
/** 转发微博的昵称 */
@property(nonatomic,assign)CGRect nameframe;
/** 转发微博正文 */
@property(nonatomic,assign)CGRect textframe;
/** 转发微博自己的frame */
@property(nonatomic,assign)CGRect retweetedframe;
/** 转发微博的数据 */
@property(nonatomic,strong)MyWeiboModel *retweetedweibo;
@end
**********************************************************************************************************************
************************************************************************************************************************
***********************************************************************************************************************
//
// MyweiboRetweetedFrame.m
// 新浪微博
//
// Created by Jose on 15-4-20.
// Copyright (c) 2015年 jose. All rights reserved.
//
#import "MyweiboRetweetedFrame.h"
#import "MyWeiboModel.h"
#import "MyUserModel.h"
#import "Global.h"
@implementation MyweiboRetweetedFrame
-(void)setRetweetedweibo:(MyWeiboModel *)retweetedweibo{
_retweetedweibo=retweetedweibo;
//1.计算转发微博的昵称
CGFloat namex=CellMargin;
CGFloat namey=CellMargin;
//在转发微博的昵称面前加上@
NSString *name=[NSString stringWithFormat:@"@%@",self.retweetedweibo.user.name];
CGSize namesize=[name sizeWithFont:RetweetedName];
self.nameframe=(CGRect){{namex,namey},namesize};
//2.计算转发微博的正文
CGFloat textx=CellMargin;
CGFloat texty=CGRectGetMaxY(self.nameframe)+CellMargin;
CGFloat maxw=ScreenBounds.size.width-2*CellMargin;
CGSize maxsize=CGSizeMake(maxw, MAXFLOAT);
CGSize textsize=[self.retweetedweibo.text sizeWithFont:RetweetedText constrainedToSize:maxsize];
self.textframe=(CGRect){{textx,texty},textsize};
//3.计算转发微博自己的frame
CGFloat x=0;
//y是原创微博的最大y值,默认是0
CGFloat y=0;
CGFloat w=ScreenBounds.size.width;
CGFloat h=CGRectGetMaxY(self.textframe)+CellMargin;
self.retweetedframe=CGRectMake(x, y, w, h);
}
@end
- 新浪微博开发之三十(转发微博frame)
- 新浪微博开发之三十二(原创微博和转发微博frame)
- 新浪微博开发之三十五(微博frame)
- 新浪微博开发之二十八(原创微博frame)
- 新浪微博开发之三十一(转发微博view)
- (droid分享)新浪微博开发系列【十三】之微博的评论转发
- 新浪腾讯微博转发 js代码
- 35day 新浪微博(CELL转发)
- 新浪微博开发之php开发
- IOS开发之新浪微博OAuth2
- 新浪微博数据挖掘食谱之九: 用户篇 (获取转发微博的用户名)
- 新浪微博数据挖掘食谱之十: 元素篇 (提取转发微博的元素)
- 新浪微博开发之十四(AFNetworking的使用 )
- 新浪微博开发之十五(MBProgressHUD的使用)
- 新浪微博开发之十六(封装网络工具)
- 新浪微博开发之十七(图片工具)
- 新浪微博开发之十八(文本框)
- 新浪微博开发之十九(文本框工具栏)
- python_unittest
- [leetcode]Isomorphic Strings
- MFC学习一
- ViewPager的使用方法
- 简易Linux服务器配置--Samba服务
- 新浪微博开发之三十(转发微博frame)
- js创建年日历
- 异常:javax.xml.Stream.FactoryFinder$ConfigurationError:Provider com.sun.xml.Stream.ZephyrParserFactory
- 为什么启动Activity都是写的super.onCreate
- Socket连接实例
- allegro问题总结
- you must restart adb and eclipse的相关解决办法
- Isomorphic Strings
- CSU1511(BFS)