新浪微博客户端(24)-计算原创微博配图frame
DJStatus.h
#import <Foundation/Foundation.h> @class DJUser; /** 微博 */
@interface DJStatus : NSObject /** 微博id */
@property (nonatomic,copy) NSString *idstr;
/** 微博内容 */
@property (nonatomic,copy) NSString *text;
/** 微博关联用户 */
@property (nonatomic,strong) DJUser *user;
/** 发布日期 */
@property (nonatomic,copy) NSString *created_at;
/** 来源 */
@property (nonatomic,copy) NSString *source;
/** 配图 */
@property (nonatomic,strong) NSArray *pic_urls; @end
DJStatus.m
#import "DJStatus.h"
#import "MJExtension.h"
#import "DJPhoto.h" @implementation DJStatus + (NSDictionary *)mj_objectClassInArray { return @{@"pic_urls":[DJPhoto class]}; } @end
DJPhoto.h
#import <Foundation/Foundation.h> @interface DJPhoto : NSObject /** 图片缩略图 */
@property (nonatomic,copy) NSString *thumbnail_pic; @end
DJStatusCellFrame.m
// 配图
CGFloat originalH;
if (self.status.pic_urls.count) { // 有配图
CGFloat photoX = contentX;
CGFloat photoY = CGRectGetMaxY(self.contentLabelF) + DJStatusCellMargin;
CGFloat photoWH = ;
self.photoViewF = CGRectMake(photoX, photoY, photoWH, photoWH);
originalH = CGRectGetMaxY(self.photoViewF) + DJStatusCellMargin;
} else { // 无配图
originalH = CGRectGetMaxY(self.contentLabelF) + DJStatusCellMargin;
}
最终效果:

新浪微博客户端(24)-计算原创微博配图frame的更多相关文章
- 新浪微博客户端(23)-计算Cell内控件的frame
DJStatusCellFrame.m #import "DJStatusCellFrame.h" #import "DJStatus.h" #import & ...
- 1014-34-首页15-计算原创微博的frame------计算cell的高度---计算 UILabel 的 CGSize 的方法
一.总体思路: 在控制器中,每次拿到数据模型(请求了数据.加载新微博)的时候,就调用 - (NSArray *)stausFramesWithStatuses:(NSArray *)statuses, ...
- 新浪微博客户端(22)-创建微博Cell
DJStatusCell.h #import <UIKit/UIKit.h> @class DJStatusCellFrame; @interface DJStatusCell : UIT ...
- [iOS微博项目 - 4.6] - 微博配图
github: https://github.com/hellovoidworld/HVWWeibo A.微博配图 1.需求 显示原创微博.转发微博的缩略图 4张图使用2x2布局,其他使用3x3布局, ...
- [Python爬虫] Selenium爬取新浪微博客户端用户信息、热点话题及评论 (上)
转载自:http://blog.csdn.net/eastmount/article/details/51231852 一. 文章介绍 源码下载地址:http://download.csdn.net/ ...
- android开发新浪微博客户端 完整攻略 [新手必读]
开始接触学习android已经有3个礼拜了,一直都是对着android的sdk文档写Tutorials从Hello World到Notepad Tutorial算是初步入门了吧,刚好最近对微博感兴趣就 ...
- Aisen仿新浪微博客户端项目源码
新浪目前已经限制了第三方微博的很多API接口,加上平常时间不够,所以后续可能不会面向产品的去维护Aisen,不过也有了一些新的方向,例如引入最新Android-support-library,在一个完 ...
- 新浪微博客户端开发之OAuth认证篇
新浪微博客户端开发之OAuth认证篇 2013年7月29日新浪微博客户端开发 OAuth2.0授权机制我在这里就不浪费口舌了,有很多大牛都发表过相关的文章解释OAuth2.0认证的流程,我就随便找了一 ...
- FMS 客户端带宽计算、带宽限制
FMS 客户端带宽计算.带宽限制 1. 带宽计算 FMS内置了带宽检测的特性(被称作"native bandwidth detection"),要进行带宽检测,客户端只要在成功连接 ...
随机推荐
- LeetCode:Binary Tree Level Order Traversal I II
LeetCode:Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of ...
- CodeForces 166E -Tetrahedron解题报告
这是本人写的第一次博客,学了半年的基础C语言,初学算法,若有错误还请指正. 题目链接:http://codeforces.com/contest/166/problem/E E. Tetrahedro ...
- VS2010版快捷键
VS2010版快捷键 Ctrl+E,D ----格式化全部代码 Ctrl+E,F ----格式化选中的代码 CTRL + SHIFT + B生成解决方案 CTRL + F7 生成编译 CTRL + O ...
- 一套简单可依赖的Javascript库
还是[百度]的产品——Tangram不是我偏心,百度不是我亲戚这东西看上去确实不错 Tangram是一套简单可依赖的Javascript库,主要分为Base和Component两部分.Base提供了开 ...
- at org.apache.catalina.loader.WebappClassLoader.loadClass问题处理
在连接oracle数据库时,正常的java application可以连接,但是到javabean web中就出错,说是Class.forName(dirver)找不到驱 动,问题是,我将oracle ...
- nginx 下 location 配置解释
当我们在使用负载均衡和反向代理的时候 我们会考到虚拟主机下面有着个配置 现在我们看一下反向代理的location 下面的配置实例: server { listen 80 ; 监听的端口号 ser ...
- 在 Visual Studio 2013 中创建 ASP.NET Web 项目(1):概述 - 创建 Web 应用程序项目
注:本文是“在 Visual Studio 2013 中创建 ASP.NET Web 项目”专题的一部分,详情参见 专题导航 . 预备知识 本专题适用于 Visual Studio 2013 及以上版 ...
- @SuppressWarnings含义
J2SE 提供的最后一个批注是 @SuppressWarnings.该批注的作用是给编译器一条指令,告诉它对被批注的代码元素内部的某些警告保持静默. @SuppressWarnings 批注允许您选择 ...
- asp.net input怎么获取值
前台: <input type="hidden" name="content" value="content"> 后台: Req ...
- 洛谷P1508 Likecloud-吃、吃、吃
题目背景 问世间,青春期为何物? 答曰:“甲亢,甲亢,再甲亢:挨饿,挨饿,再挨饿!” 题目描述 正处在某一特定时期之中的李大水牛由于消化系统比较发达,最近一直处在饥饿的状态中.某日上课,正当他饿得头昏 ...