ios第3天的气泡作业
来源:互联网 发布:软件测试的基本技能 编辑:程序博客网 时间:2024/04/27 14:39
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
下面是程序执行后的结果
0 0
- ios第3天的气泡作业
- ios气泡动画效果的简单实现
- iOS 画地图上的标注气泡
- 蓝鲸的第3项作业。
- 第四周的作业
- iOS 气泡聊天效果
- IOS气泡动画教程
- iOS 画气泡
- iOS 绘制气泡图案
- iOS制作聊天气泡
- iOS 自定义绘制气泡
- 【iOS】Mapkit的使用:地图显示、定位、大头针、气泡等
- iOS中气泡对话框拉伸效果视图的实现
- iOS百度地图自定义大头针和气泡内的内容
- 仿iOS中弹框气泡菜单的控件
- 高德地图IOS自动显示大头针标注的气泡
- 第 3堂作业
- 第 3堂作业
- 机器学习公开课笔记(8):k-means聚类和PCA降维
- 【Android】获取控件的宽和高
- 关于每天的工作量,集中精力干一件事,其他时间就是玩,逐步完善自己的时间分配
- 关于maven的基本理解
- linux查找指定大小的文件
- ios第3天的气泡作业
- 【HDU】 2602 Bone Collector
- 关于共享内存的使用
- 程序猿之华丽转身:菜鸟4步曲!
- C和C++语言编程里面常用函数或者编程技巧总结(不断更新)
- select()实现
- 电容式触控芯片FAQ
- 【HDU】 2191 救灾
- Android学习路线