博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
不同字的练习
阅读量:4332 次
发布时间:2019-06-07

本文共 8111 字,大约阅读时间需要 27 分钟。

#import "FisrtViewController.h"#import "ViewController.h"@interface FisrtViewController ()@end@implementation FisrtViewController- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];    if (self) {        // Custom initialization    }    return self;}- (void)viewDidLoad{    [super viewDidLoad];    //添加一个图片    UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];    imageView.image=[UIImage imageNamed:@"bg_03"];    [self.view addSubview:imageView];        //添加第一字的按钮    UIButton *diYiZiBtn=[UIButton buttonWithType:UIButtonTypeCustom];    diYiZiBtn.frame=CGRectMake(24, 64, 100, 40);    [diYiZiBtn setImage:[UIImage imageNamed: @"WA~0001"] forState:UIControlStateNormal];    [diYiZiBtn addTarget:self action:@selector(diYiZi) forControlEvents:UIControlEventTouchUpInside];    [self.view addSubview:diYiZiBtn];        //添加第2字的按钮    UIButton *di2ZiBtn=[UIButton buttonWithType:UIButtonTypeCustom];    di2ZiBtn.frame=CGRectMake(214, 64, 100, 40);    [di2ZiBtn setImage:[UIImage imageNamed: @"TA~0001"] forState:UIControlStateNormal];    [di2ZiBtn addTarget:self action:@selector(di2Zi) forControlEvents:UIControlEventTouchUpInside];    [self.view addSubview:di2ZiBtn];}- (void)diYiZi{    ViewController *diYiZiViewContl=[[ViewController alloc]init];    diYiZiViewContl.title=@"1";    [self.navigationController pushViewController:diYiZiViewContl animated:YES];}- (void)di2Zi{    ViewController *di2ZiViewContl=[[ViewController alloc]init];    di2ZiViewContl.title=@"2";    [self.navigationController pushViewController:di2ZiViewContl animated:YES];}////  ViewController.m//  外文语音-0714////  Created by apple on 14-7-14.//  Copyright (c) 2014年 戴维营教育. All rights reserved.//#import "ViewController.h"#import 
@interface ViewController (){ UIImageView *biHuaImageView; SystemSoundID soundID; SystemSoundID soundID2; }@end@implementation ViewController- (void)backgView{ UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 44, 320, 418)]; imageView.image=[UIImage imageNamed:@"kanaDetailBgImg"]; [self.view addSubview:imageView]; UIImageView *imageView1=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 49)]; imageView1.image=[UIImage imageNamed:@"titleView"]; [self.view addSubview:imageView1]; UIImageView *imageView2=[[UIImageView alloc]initWithFrame:CGRectMake(0, self.view.frame.size.height-49, 320, 49)]; imageView2.image=[UIImage imageNamed:@"bottomBg"]; [self.view addSubview:imageView2]; UIImageView *lianXiImage=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"practiceBtn_01"]]; lianXiImage.frame=CGRectMake(110, 10, 90, 30); [imageView1 addSubview:lianXiImage];}- (void)button{ UIButton *backBtn=[UIButton buttonWithType:UIButtonTypeCustom]; backBtn.frame=CGRectMake(10, 4, 100, 30); [backBtn setImage:[UIImage imageNamed:@"backBtn"] forState:UIControlStateNormal]; [backBtn addTarget:self action:@selector(backclike:) forControlEvents:UIControlEventTouchUpInside ]; [self.view addSubview:backBtn]; UIButton *backBtn1=[UIButton buttonWithType:UIButtonTypeCustom]; backBtn1.frame=CGRectMake(210, 4, 100, 30); [backBtn1 setImage:[UIImage imageNamed:@"clearBtn"] forState:UIControlStateNormal]; [backBtn1 addTarget:self action:@selector(backclike2:) forControlEvents:UIControlEventTouchUpInside ]; [self.view addSubview:backBtn1]; #pragma mark-发音按钮 UIButton *yuYinBtn=[UIButton buttonWithType:UIButtonTypeCustom]; yuYinBtn.frame=CGRectMake(10,self.view.frame.size.height-40, 100, 30); [yuYinBtn setImage:[UIImage imageNamed:@"pronounceBtn_01"] forState:UIControlStateNormal]; [yuYinBtn setImage:[UIImage imageNamed:@"pronounceBtn_02"] forState:UIControlStateHighlighted]; [yuYinBtn addTarget:self action:@selector(yuYinBtn:) forControlEvents:UIControlEventTouchUpInside ]; [self.view addSubview:yuYinBtn]; #pragma mark-笔画按钮 UIButton *biHuaBtn=[UIButton buttonWithType:UIButtonTypeCustom]; biHuaBtn.frame=CGRectMake(110,self.view.frame.size.height-40, 100, 30); [biHuaBtn setImage:[UIImage imageNamed:@"strokeOrderBtn_01"] forState:UIControlStateNormal]; [biHuaBtn setImage:[UIImage imageNamed:@"strokeOrderBtn_02"] forState:UIControlStateHighlighted]; [biHuaBtn addTarget:self action:@selector(biHuaBtn:) forControlEvents:UIControlEventTouchUpInside ]; [self.view addSubview:biHuaBtn]; UIButton *nextBtn=[UIButton buttonWithType:UIButtonTypeCustom]; nextBtn.frame=CGRectMake(210,self.view.frame.size.height-40, 100, 30); [nextBtn setImage:[UIImage imageNamed:@"arrow_right"] forState:UIControlStateNormal]; [nextBtn setImage:[UIImage imageNamed:@"arrow_right"] forState:UIControlStateHighlighted]; [nextBtn addTarget:self action:@selector(nextBtn:) forControlEvents:UIControlEventTouchUpInside ]; [self.view addSubview:nextBtn]; }- (void)biHuaDongHua{ if(self.title==@"1") { NSMutableArray *array=[[NSMutableArray alloc]init]; for (int i=1; i<11; i++) { NSString *str=[NSString stringWithFormat:@"WA~%04d",i]; UIImage *image=[UIImage imageNamed:str]; [array addObject:image]; } biHuaImageView=[[UIImageView alloc] initWithFrame:CGRectMake(80, 146,160, 160)]; biHuaImageView.image=[UIImage imageNamed:@"WA~0001"]; biHuaImageView.animationImages=array; biHuaImageView.backgroundColor=[UIColor colorWithRed:0.3 green:0.4 blue:0.5 alpha:0.5]; biHuaImageView.animationDuration=5; biHuaImageView.animationRepeatCount=1; [self.view addSubview:biHuaImageView]; } else { NSMutableArray *array=[[NSMutableArray alloc]init]; for (int i=1; i<13; i++) { NSString *str=[NSString stringWithFormat:@"TA~%04d",i]; UIImage *image=[UIImage imageNamed:str]; [array addObject:image]; } biHuaImageView=[[UIImageView alloc] initWithFrame:CGRectMake(80, 146,160, 160)]; biHuaImageView.image=[UIImage imageNamed:@"TA~0001"]; biHuaImageView.animationImages=array; biHuaImageView.backgroundColor=[UIColor colorWithRed:0.3 green:0.4 blue:0.5 alpha:0.5]; biHuaImageView.animationDuration=5; biHuaImageView.animationRepeatCount=1; [self.view addSubview:biHuaImageView]; }}- (void)backclike:(UIButton *)sender{ NSLog(@"%s",__PRETTY_FUNCTION__);}- (void)nextBtn:(UIButton *)sender{ NSLog(@"%s",__PRETTY_FUNCTION__); CGAffineTransform transform; if (biHuaImageView.tag == 0) { //transform = CGAffineTransformMakeTranslation(biHuaImageView.frame.origin.x, 100.0); transform = CGAffineTransformScale(biHuaImageView.transform, 2, 1.8); // [biHuaImageView setTag:1]; [biHuaImageView setTag:1]; } else { // transform = CGAffineTransformMakeTranslation(0, 0); transform = CGAffineTransformScale(biHuaImageView.transform, 1/2.0, 1/1.8); [biHuaImageView setTag:0]; } [biHuaImageView setTransform:transform];}- (void)backclike2:(UIButton *)sender{ NSLog(@"%s",__PRETTY_FUNCTION__);}- (void)yuYinBtn:(UIButton *)sender{ NSLog(@"%s",__PRETTY_FUNCTION__); if (self.title==@"1") { AudioServicesPlaySystemSound(soundID); } else { AudioServicesPlaySystemSound(soundID2); }}- (void)biHuaBtn:(UIButton *)sender{ [biHuaImageView startAnimating]; biHuaImageView.image=[UIImage imageNamed:@"WA~0010"]; NSLog(@"%s",__PRETTY_FUNCTION__);}- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self backgView]; [self button]; [self biHuaDongHua]; NSURL *url=[[NSBundle mainBundle] URLForResource:@"053_he" withExtension:@"mp3"]; AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID); NSURL *url2=[[NSBundle mainBundle] URLForResource:@"010_ka" withExtension:@"mp3"]; AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url2), &soundID2);}

转载于:https://www.cnblogs.com/lidongq/p/3849562.html

你可能感兴趣的文章
项目管理过程
查看>>
泛型使用
查看>>
Employment Planning[HDU1158]
查看>>
hdu2089:不要62(基础数位dp)
查看>>
Tools
查看>>
JS获取第二个横杠后面的内容
查看>>
excel 导入MYSQL
查看>>
P3038 [USACO11DEC]牧草种植Grass Planting
查看>>
23 个最有吸引力和免费的Flash图像轮廓
查看>>
给label添加点击事件
查看>>
eterna 第一个案例
查看>>
新部署到服务器 报 The requested URL /home/profession was not found on this server. 错误
查看>>
hadoop从非HA转到NAMENODE HA时需要注意的一个问题
查看>>
KnockoutJs学习笔记(十一)
查看>>
访问修饰符public、private、protect、default范围
查看>>
jQuery实现布局高宽自适应
查看>>
《学习》10函数的建立与使用
查看>>
去除TB二合一页面弹窗
查看>>
托管和非托管的区别。
查看>>
win7与VMware ubuntu虚拟机实现文件共享(最后一定要装open-vm-dkms插件)
查看>>