日语五十音图前几个页面关于导航器的简单代码分享

//AppDalegate部分- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    //设置view和导航
    ViewController1 *viewCtrl1 = [[ViewController1 alloc] init];
    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:viewCtrl1];
    navi.navigationBarHidden = YES;
    self.window.rootViewController = navi;

    return YES;
}
//封装按钮
- (UIButton *)gzybutton:(NSString *)image andFrame:(CGRect)frame0 andAction:(SEL)action0
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    UIImage *image1 = [UIImage imageNamed:image];
    [btn setImage:image1 forState:UIControlStateNormal];
    [btn addTarget:self action:action0 forControlEvents:UIControlEventTouchUpInside];
    btn.frame = frame0;
    [self.view addSubview:btn];
    return btn;
}

//封装视图
- (UIImageView *)gzyView :(NSString *)image0 andFram :(CGRect)fram
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:fram];
    UIImage *image = [UIImage imageNamed:image0];
    [imageView setImage:image];
    [self.view addSubview:imageView];
    return imageView;
}

//-------------------------------华丽的分割线----------------------------------
//加载视图
- (void) loadImage
{
    [self gzyView:@"main_Bg" andFram:CGRectMake(0, 0, 320, 580)];
}
//加载按钮
- (void) creatBtn
{
    [self gzybutton:@"main_study" andFrame:CGRectMake(10, 400, 93, 163) andAction:@selector(nextPage:)];

}

//按钮的功能
- (void) nextPage :(UIButton *)sender
{
    ViewController2 *viewCtrl2 = [[ViewController2 alloc]init];
    [self.navigationController pushViewController:viewCtrl2 animated:YES];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self loadImage];
    [self creatBtn];
}

第二个viewController

//封装按钮
- (UIButton *)gzybutton:(NSString *)image andFrame:(CGRect)frame0 andAction:(SEL)action0
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    UIImage *image1 = [UIImage imageNamed:image];
    [btn setImage:image1 forState:UIControlStateNormal];
    [btn addTarget:self action:action0 forControlEvents:UIControlEventTouchUpInside];
    btn.frame = frame0;
    [self.view addSubview:btn];
    return btn;
}

//封装所有日文按钮
- (UIButton *) japanNextFram :(CGRect)fram andAction :(SEL)action
{
    UIButton *btn3 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn3.frame = fram;
    //    btn3.backgroundColor = [UIColor clearColor];
    btn3.backgroundColor = [UIColor clearColor];
    [btn3 addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn3];
    return btn3;
}

//封装视图
- (UIImageView *)gzyView :(NSString *)image0 andFram :(CGRect)fram
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:fram];
    UIImage *image = [UIImage imageNamed:image0];
    [imageView setImage:image];
    [self.view addSubview:imageView];
    return imageView;
}
//日文字母按钮
//- (void)kkk
//{
//    UIButton *btn3 = [UIButton buttonWithType:UIButtonTypeCustom];
//    btn3.frame = CGRectMake(20, 24, 101, 80);
////    btn3.backgroundColor = [UIColor clearColor];
//    btn3.backgroundColor = [UIColor yellowColor];
//    [btn3 addTarget:self action:@selector(<#selector#>) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:btn3];
//
//}

//按钮
- (void) backBtn
{
    [self gzybutton:@"backBtn" andFrame:CGRectMake(5, 25, 70, 35) andAction:@selector(back:)];
    [self japanNextFram:CGRectMake(50, 74, 50, 60) andAction:@selector(gzyAiNext:)];
}

//按钮的方法
- (void) back :(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void) jumpAd :(UIButton *)sender

{
    AdViewController *adView = [[AdViewController alloc] init];
    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:adView];
    [self presentModalViewController:navi animated:YES];
}

- (void) gzyAiNext :(UIButton *)sender
{
    ViewController3 *viewCTRL = [[ViewController3 alloc] init];

    [self.navigationController pushViewController:viewCTRL animated:YES];
}

//视图
- (void) creatView
{
    [self gzyView:@"bg_01_01" andFram:CGRectMake(0, 64, 320, 418)];
    [self gzyView:@"titleView" andFram:CGRectMake(0, 20, 320, 49)];
}
//按钮
- (void) creatBtn
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"advertisiment!!!" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor purpleColor] forState:UIControlStateNormal];
    btn.frame = CGRectMake(0, 480, 320, 70);
    btn.backgroundColor = [UIColor grayColor];
    [btn addTarget:self action:@selector(jumpAd:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self creatView];
    [self backBtn];
    [self creatBtn];
    // Do any additional setup after loading the view.
}

日语五十音图前几个页面关于导航器的简单代码分享

时间: 2024-08-03 15:25:30

日语五十音图前几个页面关于导航器的简单代码分享的相关文章

一个练习日语五十音图的小工具

<html> <head> <title>五十音练习</title> <style type="text/css"> label { font-size:50px; font-face:微软雅黑; } </style> <script type="text/javascript"> var element = ["あ","い","う&

日语歌曲巧记五十音图

若你还是个堪堪步入日语学习大门的小学徒,那么五十音图便是横亘在你眼前的一座大山.不攻克五十音图,就无法正式开始学习日语的道路. 死记硬背谁都会,但填鸭式的学习难免让人感到枯燥无味,导致不是早早放弃就是基础不牢.那么有什么好的方法来记忆五十音呢?唱歌,就是一个相当不错的选择.日语歌曲中有不少关于五十音的歌,就让我们跟着动人的日语歌曲学习五十音吧! 1.花澤香菜 <sweets parade> 犹记得香菜的一曲<恋爱循环>让多少死宅拜倒在其软萌的萝莉音下,想必跟着香菜女神学五十音必然是

Japanese Learning - 五十音图

平假名: 片假名: あ い う え お ア イ ウ エ オ か き く け こ カ キ ク ケ コ さ し す せ そ サ シ ス セ ソ た ち つ て と        タ チ ツ テ ト な に ぬ ね の ナ 二 ヌ ネ ノ は ひ ふ へ ほ ハ ヒ フ ヘ ホ ま み む め も マ ミ ム メ モ や い ゆ え よ ヤ イ ユ エ ヨ ら り る れ ろ ラ リ ル レ ロ わ い う え を ワ イ ウ エ ヲ ん ン

【日语学习】五十音课程学习Lesson-1

叶子(人名) ---> 发音为Yoko 先生 ---> 在日语中指的是老师,せんせい,se n se i 日本文字的构成: 1)平假名 ---> 它的字体比较圆滑,是由汉字的草书变化而来的.一般用来记录日本原来就有的词语. 2)片假名 ---> 长相硬朗,有棱有角,由汉字的偏旁部首变化而来,一般用来记录西方的外来语,如欧美的人名或者地名等等. 平假名和片假名之间有一一对应的关系,对应的词发音相同. 3)汉字 ---> 它有专门的假名读法,不可以用中国汉字的原意来解释日本的汉字

可牛看图web开放平台---PHP表单上传代码分享

首先打开zendstudio编辑器:直接上代码: ?1234567891011121314151617181920212223 0) { $filename = $save_path . '/' . uniqid() . '.jpg'; $handle = fopen($filename, 'w+'); fwrite($handle, $postdata); fclose($handle); if (is_file($filename)) { echo 'Image data save succ

日语(五十元音)_01

一五十元音图 あアa いイi うウu えエe おオo かカka きキki くクku けケke こコko さサsa しシsi すスsu せセse そソso たタta ちチti つツtu てテte とトto なナna に二ni ぬヌnu ねネne のノ はハha ひヒ ふフ へヘ ほホ まマma みミ むム めメ もモ やヤya ゆユ よヨ らラla りリ るル れレ ろロ わワwa をヲ んンnn 原文地址:https://www.cnblogs.com/heguoqing/p/10301552.

不出五十年清朝必亡——曾国藩和心腹幕僚赵烈文秘谈录

来源:南方周末 1867年六月,赵烈文在与曾国藩谈话时预言:不出50年,清朝必亡.44年后,清朝果然土崩瓦解,接踵而来的混乱局面,也为赵烈文所言中:“必先根本颠仆,而后方州无主,人自为政.”从现存的文献资料来看,赵烈文大概是第一个准确地做出这种预见的人. 1865年,捻军在山东击毙僧格林沁后,清廷大为震动,急调曾国藩督师北讨.曾国藩北上时,他的心腹幕僚赵烈文(字惠甫)一直送到江都北边的邵伯镇才返回.在这一个多星期里,两人的关系翻开了新的一页:经不住赵烈文的请求,曾国藩答应收下这个弟子,并在邵伯镇

一起talk C栗子吧(第一百五十九回:C语言实例--基于AF_INET域的数据报套接字通信)

各位看官们,大家好,上一回中咱们说的是基于AF_INET域的流套接字通信的例子,这一回咱们说的例子是:基于AF_INET域的数据报套接字通信 .闲话休提,言归正转.让我们一起talk C栗子吧! 看官们,我们在上一回中一起制作了我们的第三道佳肴是:基于AF_INET域的流套接字通信.今天,我将和大家一起制作第四道佳肴:基于AF_INET域的数据报套接字通信. 制作第四道佳肴的菜谱:数据报套接字过程. 制作第四道佳肴的食材:数据报套接字的接口,套接字属性,套接字地址信息. 看官们,以上的内容,我们

hdu 1290 献给杭电五十周年校庆的礼物

献给杭电五十周年校庆的礼物 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7236    Accepted Submission(s): 3936 Problem Description 或许你曾经牢骚满腹 或许你依然心怀忧伤 或许你近在咫尺 或许你我天各一方 对于每一个学子 母校 永远航行在 生命的海洋 今年是我们杭电建校五十周年,