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的更多相关文章

  1. 新浪微博客户端(23)-计算Cell内控件的frame

    DJStatusCellFrame.m #import "DJStatusCellFrame.h" #import "DJStatus.h" #import & ...

  2. 1014-34-首页15-计算原创微博的frame------计算cell的高度---计算 UILabel 的 CGSize 的方法

    一.总体思路: 在控制器中,每次拿到数据模型(请求了数据.加载新微博)的时候,就调用 - (NSArray *)stausFramesWithStatuses:(NSArray *)statuses, ...

  3. 新浪微博客户端(22)-创建微博Cell

    DJStatusCell.h #import <UIKit/UIKit.h> @class DJStatusCellFrame; @interface DJStatusCell : UIT ...

  4. [iOS微博项目 - 4.6] - 微博配图

    github: https://github.com/hellovoidworld/HVWWeibo A.微博配图 1.需求 显示原创微博.转发微博的缩略图 4张图使用2x2布局,其他使用3x3布局, ...

  5. [Python爬虫] Selenium爬取新浪微博客户端用户信息、热点话题及评论 (上)

    转载自:http://blog.csdn.net/eastmount/article/details/51231852 一. 文章介绍 源码下载地址:http://download.csdn.net/ ...

  6. android开发新浪微博客户端 完整攻略 [新手必读]

    开始接触学习android已经有3个礼拜了,一直都是对着android的sdk文档写Tutorials从Hello World到Notepad Tutorial算是初步入门了吧,刚好最近对微博感兴趣就 ...

  7. Aisen仿新浪微博客户端项目源码

    新浪目前已经限制了第三方微博的很多API接口,加上平常时间不够,所以后续可能不会面向产品的去维护Aisen,不过也有了一些新的方向,例如引入最新Android-support-library,在一个完 ...

  8. 新浪微博客户端开发之OAuth认证篇

    新浪微博客户端开发之OAuth认证篇 2013年7月29日新浪微博客户端开发 OAuth2.0授权机制我在这里就不浪费口舌了,有很多大牛都发表过相关的文章解释OAuth2.0认证的流程,我就随便找了一 ...

  9. FMS 客户端带宽计算、带宽限制

    FMS 客户端带宽计算.带宽限制 1. 带宽计算 FMS内置了带宽检测的特性(被称作"native bandwidth detection"),要进行带宽检测,客户端只要在成功连接 ...

随机推荐

  1. [CareerCup] 3.5 Implement Queue using Two Stacks 使用两个栈来实现队列

    3.5 Implement a MyQueue class which implements a queue using two stacks. LeetCode上的原题,请参见我之前的博客Imple ...

  2. 20135202闫佳歆--week 7 Linux内核如何装载和启动一个可执行程序--实验及总结

    week 7 实验:Linux内核如何装载和启动一个可执行程序 1.环境搭建: rm menu -rf git clone https://github.com/megnning/menu.git c ...

  3. Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tool

    重装操作系统后,要重新配置Android开发环境.配置成功后,添加原本项目时却出现了错误! Android requires compiler compliance level 5.0 or 6.0. ...

  4. Orchard内置特性(以模块来说的)

    本文链接:http://www.cnblogs.com/souther/p/4539169.html 主目录 Orchard中有很多可以直接和多次使用的特性,这些东西在官方的Gallery中可以找到. ...

  5. [AaronYang]C#人爱学不学[6]

    不要回头,不要将就,做到这两点,人生就会简单很多幸福很多 --Aaronyang的博客(www.ayjs.net)-www.8mi.me 1. 运算符,还有哪些你能学到? 1.1 不安全运算符: si ...

  6. DOM(四)事件流

    1.冒泡型事件 浏览器的事件模型分两种:捕获型事件和冒泡型事件.由于ie不支持捕获型事件,所以以下主要以冒泡型事件作为讲解.(dubbed bubbling)冒泡型指事件安装最特定的事件到最不特定的事 ...

  7. HTML5——播放器

    有了H5的Video,妈妈再也不用担心我没安Flash插件了 根据Video提供的方法和属性,简单练习了一下,不说废话,直接上图片和代码 <html><head><tit ...

  8. UIScrollView和UIPageController

    实现代码: // // ViewController.m // UIpageControl // // Created by dllo on 16/3/10. // Copyright © 2016年 ...

  9. hdu1588 矩阵快速幂

    //看了很多的博客 后来队友指点才懂//sum=f(g(0))+f(g(1))+.... //sum=A^(b-1)*|...|.... //要将b-1换,防止出现b=0时有负一,用A^b代替,取下面 ...

  10. 33.Android之Fragment学习

    Fragment Android是在Android 3.0 (API level 11)开始引入Fragment的. 可以把Fragment想成Activity中的模块,这个模块有自己的布局,有自己的 ...