ios第3天的气泡作业
ios第3天的气泡作业
//
// ViewController.m
// UIIMage
//
// Created by 王磊 on 16/1/20.
// Copyright © 2016年 wangleilei. All rights reserved.
//#import "ViewController.h"@interface ViewController ()
- (IBAction)stop:(id)sender;
- (IBAction)play:(id)sender;
@property(nonatomic,strong) UIImageView* imageView;
@end@implementation ViewController- (void)viewDidLoad {[super viewDidLoad];NSDictionary* dict = @{NSFontAttributeName:[UIFont systemFontOfSize:30],NSForegroundColorAttributeName:[UIColor blueColor]};UIEdgeInsets insets = UIEdgeInsetsMake(56, 35, 23, 25);// UIView* v = [[UIView alloc]init];UIImage* image = [UIImage imageNamed:@"qipao"];UIImageView* imageView = [[UIImageView alloc]init ];// CGRectMake(20 ,40 , self.view.frame.size.width-40, 200)];// image.size = [szietofit]image = [image resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch];imageView.image = image;// lable.backgroundColor = [UIColor colorWithPatternImage:image];UILabel* lable = [[UILabel alloc]init];NSString* string = @"宇宙黑客黑客宇宙你是谁你在哪里我找不到 =====你是中国门中国国旗宇宙黑客 ����";lable.text = string;lable.numberOfLines = 0;lable.font = [UIFont systemFontOfSize:30];// lable.backgroundColor = [UIColor orangeColor];// lable.frame = imageView.frame;// lable.frame = CGRectMake(10, 10, 10, 10);CGSize size = [string boundingRectWithSize:CGSizeMake(self.view.frame.size.width - 40, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil].size;lable.frame = CGRectMake(20, 20, size.width, size.height);imageView.frame = CGRectMake(0, 20, size.width+40, size.height);// lable.center = imageView.center = self.view.center;[self.view addSubview:imageView ];[self.view addSubview:lable ];
}- (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning];// Dispose of any resources that can be recreated.
}- (IBAction)stop:(id)sender {self.imageView.animationRepeatCount = 0;[self.imageView startAnimating];}- (IBAction)play:(id)sender {self.imageView.animationRepeatCount = 1;[self.imageView stopAnimating];
}@end
下面是程序执行后的结果
ios第3天的气泡作业相关推荐
- iOS实现类似微信聊天气泡
1. 说明 要实现类似微信聊天气泡功能,主要有以下几个主要技术点需要实现: 背景图图拉伸后不变形 UILabel自适应宽度和高度 2. 背景图图拉伸后不变形 要实现背景图拉升不变形,就要设置只让指定部 ...
- 新版的iMessage就是iOS 10内隐形的浏览器
和公共市场投资者非常看好 iOS 应用的价值一样,我们将会看到在信息服务类平台上许多公司可能会如雨后春笋般冒出来. 在如今这个一言不合就发表情包,甚至直接上演表情包大战,晓之以表情包.动之以表情包的社 ...
- iOS 常用动画第三方
动画 Core Animation笔记,基本的使用方法 - Core Animation笔记,基本的使用方法:1.基本动画,2.多步动画,3.沿路径的动画,4.时间函数,5.动画组. awesome- ...
- iOS 项目源码大全 github 国内外大神
github排名https://github.com/trending,github搜索:https://github.com/search 主要工作说明: 重新整理了Xcode好用的插件,信息更详细 ...
- iOS开发常用三方库、插件、知名博客
TimLiu-iOS iOS开发常用三方库.插件.知名博客等等,期待大家和我们一起共同维护,同时也期望大家随时能提出宝贵的意见(直接提交Issues即可). 持续更新... 版本:Objective- ...
- iOS最全的三方库、插件、博客汇总
目录 UI@ 日历三方库@ 下拉刷新@ 模糊效果@ 富文本@ 图表@ 颜色@ 表相关@(TabbleView.Tabbar.即时聊天界面) TableView@ CollectionView@ 隐藏与 ...
- iOS及Mac开源项目和学习资料
iOS UI 下拉刷新 EGOTableViewPullRefresh – 最早的下拉刷新控件. SVPullToRefresh – 下拉刷新控件. MJRefresh – 仅需一行代码就可以为UI ...
- iOS - 常用的iOS Mac框架和库以及常用的中文开发博客
对于iOS以及Mac开发中常用到的一些框架,以及比较好的技术博客做了总结: 主要内容如下: UI 下拉刷新 模糊效果 AutoLayout 富文本 图表 表相关 隐藏与显示 HUD与Toast 对话框 ...
- iOS开发第三方大全
UI 下拉刷新 EGOTableViewPullRefresh- 最早的下拉刷新控件. SVPullToRefresh- 下拉刷新控件. MJRefresh- 仅需一行代码就可以为UITableVie ...
- iOS 常用第三方库及插件
//菜单切换 https://github.com/pujiaxin33/JXCategoryView //各种导航栏样式 https://github.com/rickytan/RTRootNavi ...
最新文章
- java 2d划线 刷子_Java图形设计中,利用Bresenham算法实现直线线型,线宽的控制(NO2DGRAPHICS)...
- Django学习--9 Admin
- 如何用 SpringBoot 实现并发登录人数控制(附代码)
- NetworkX系列教程(10)-算法之三:关键路径问题
- 利用 fdisk进行分区
- 安装 PrestaShop 1.6 - 详细的安装指南
- 召唤AI大神与病毒作战!Kaggle发起CORD-19数据集文本挖掘竞赛
- RocketMQ源码解析-PullConsumer取消息(1)
- CentOS 7 上搭建nginx 1.6
- XRDP与VNC的关系
- Dalvik和Java运行环境的区别
- Arcgis for Js实现graphiclayer的空间查询(续)
- unity 太阳自发光_这些太阳能概念设计,灵感来自植物!
- 大数据——Python数据爬取
- 自动化、信息化、数字化、智能化,四化解析
- 微软浏览器Edge不能上网的解决办法
- 王之泰201771010131《面向对象程序设计(java)》第三周学习总结
- Mac系统一键下载网页图片
- AMD启用虚拟化(AMD-V)
- 【时间序列】时间序列曲线平滑+预测(LSTM)