@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
_scrollview1.backgroundColor = [UIColor greenColor];//设置背景色 绿色
_scrollview2...
分类:
移动开发 时间:
2014-11-07 14:51:49
阅读次数:
284
CALayer动画的暂停,恢复,以及结束时候的回调源码如下://// ViewController.m// AnimationLineView//// Created by YouXianMing on 14/11/7.// Copyright (c) 2014年 YouXianMing. ...
分类:
其他好文 时间:
2014-11-07 14:22:09
阅读次数:
282
一个ViewController,一般通过init或initWithNibName来加载。二者没有什么不同,init最终还是要调用initWithNibName方法(除非这个ViewController没有nib文件)。我们经常在initWithNibName方法中初始化视图,变量或者其他成员。这是...
分类:
其他好文 时间:
2014-11-07 08:37:50
阅读次数:
127
步骤一:
#import "AppDelegate.h"
步骤二:
在需要跳转的地方:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
UITabBarController *tabViewController = (UITabBarContro...
分类:
移动开发 时间:
2014-11-07 01:01:59
阅读次数:
213
子view添加到有controller的父view时,在点击子view中的什么东西时,如果要调用父view的controller导航push到一个新viewController,那么直接用下面的代码就可以了(本人也遇到这个问题,以下代码在IOS7和IOS6.1上都亲测通过)
//获取view的controller
-(UIViewController*)view..
分类:
其他好文 时间:
2014-11-06 15:07:12
阅读次数:
192
#import?"ViewController.h"
@implementation?ViewController
NSArray?*category;??//第一列存储类别
NSArray?*name;??//第二列存储该列别下对应的名称
NSDictionary?*data;
NSString?*defaultSel;?...
分类:
移动开发 时间:
2014-11-06 13:15:00
阅读次数:
282
单击一个已有的按钮后自动创建一个新的按钮,并为新按钮添加事件,使得单击时弹出提示框。
在viewcontroller.h中添加
@property (weak,
nonatomic) IBOutlet
UIButton *addbutton;
为这个按钮添加响应事件addbutton
在viewcontroller.m中添加
- (IBAction)ad...
分类:
移动开发 时间:
2014-11-05 14:55:04
阅读次数:
397
ViewController.h中定义按钮 btn1;
@property (weak,
nonatomic) IBOutlet
UIButton *btn1;
ViewController.m中实现按下按钮跳转到:qqqViewController;
- (IBAction)btn1:(i...
分类:
移动开发 时间:
2014-11-04 19:48:45
阅读次数:
196
1.之前的项目一直用mvc开发ios,发现ios有一个弊端,mvc里,viewcontroller里边有大量的业务逻辑,当不断的修改,会发现只是一个痛苦的过程。
2.之前做wpf,使用过mvvm模式,可以把业务逻辑放到vm模式,vm可以来处理业务逻辑。做过几个ios项目,也想过mvvm模式,但是一直没找到。偶尔看到网上有一个mvvm模式的ios项目,我来尝试从头开始做这个项目,做完之后源码会公...
分类:
移动开发 时间:
2014-11-03 22:34:37
阅读次数:
445
iOS开发UI篇—UITabBarController生命周期(使用storyoard搭建)一、UITabBarController在storyoard中得搭建1.新建一个项目,把storyboard中默认的控制器删除,拖UITab Bar Controller。2.创建viewcontroller...
分类:
移动开发 时间:
2014-11-02 22:20:46
阅读次数:
222