
IOS入门
文章平均质量分 81
风云正
小伙子好好干,将来考个好大学!
展开
-
ios键盘收起的常见方法
1.如果只有一个文本框的情况下,可以直接设置文本框释放焦点,代码如下:[self.nameTextField resignFirstResponder];2.如果一个页面文本框很多的情况下,上面这种挨个取消焦点的方法肯定不合适,这里我们找到父视图,设置编辑状态结束,代码如下:[self.view endEditing:YES];3.可以直接在ViewController原创 2016-07-14 16:08:04 · 907 阅读 · 0 评论 -
ios基础控件UIAlertView与UIActionSheet
1.UIAlertView首先来看下UIAlertView的实现效果图:第一步通过点击外部按钮弹出提醒对话框- (IBAction)showAlertView:(id)sender { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"标题" message:@"提醒内容" delegate:self canc原创 2016-07-14 17:53:34 · 520 阅读 · 0 评论 -
ios基于UITableViewController实现列表
实现效果图如下:News.h#import @interface News : NSObject@property (nonatomic, strong) NSString *title;@property (nonatomic) NSUInteger count;@property (nonatomic, strong) NSString *imageName;+ (N原创 2016-07-26 17:13:18 · 880 阅读 · 0 评论 -
ios基本语法
1.NSString//C -> OCchar *cstr = "hello world";NSString *str1 = [NSString stringWithUTF8String:cstr];NSLog(@"str1 = %@", str1);//OC -> CNSString *str2 = @"hello objective-c";const char *cstr1原创 2016-07-06 17:21:48 · 1244 阅读 · 0 评论 -
ios基于UITabBarController实现tab页面切换
首先,带大家来看看实现的效果图,点击底部三个tab按钮来实现页面的切换具体实现代码如下:AppDelegate.m#import "AppDelegate.h"#import "RedViewController.h"#import "GreenViewController.h"#import "BlueViewController.h"@interface AppD原创 2016-07-28 11:42:36 · 8339 阅读 · 3 评论 -
ios反向传值--代理协议
摘要:这里我们有两个ViewController,即MyFirstViewController和MySecondViewController,通过点击MyFirstViewController中按钮跳转至MySecondViewController页面中,然后在需要返回的地方将值传回至MyFirstViewController中。MyFirstViewContr原创 2016-07-20 09:30:33 · 511 阅读 · 0 评论 -
ios基于UIScrollView实现滑动引导页
上代码前,我们先来看下实现的效果图:WelcomeViewController.h#import @interface WelcomeViewController : UIViewController@endWelcomeViewController.m#import "WelcomeViewController.h"#define IMAGECOUNT原创 2016-07-22 09:55:37 · 3373 阅读 · 0 评论