08 2015 档案
摘要:控制器视图之间的转场,你可以使用模态方式或push方式。模态方式(presentViewcontroller)默认的动画效果是从下到上显示视图,当然你可以修改控制器的一个属性modalTransitionStyle来设置转场的动画。push方式(pushViewController)的前提要求当前控...
阅读全文
摘要:- (IBAction)doNetButton:(id)sender { Reachability *hostReach=[Reachability reachabilityWithHostName:@"www.baidu.com"];//网络可达性 NetworkStatus status=[...
阅读全文
摘要://// AchievementViewController.m// LIBAOZHENG0826//// Created by 张艳锋 on 15/8/27.// Copyright (c) 2015年 张艳锋. All rights reserved.//#import "Achievement...
阅读全文
摘要:UITextView *textView=[[UITextView alloc]initWithFrame:CGRectMake(20, 40, 150, 170)];//初始化并设置大小 textView.text= [ModelDataAll dataDetailFromModel:poet_...
阅读全文
摘要:[UIView animateWithDuration:0.5 animations:^{ CGAffineTransform moveTrans2=CGAffineTransformMakeTranslation(160, 0);//相对于初始位置移动的位置,原位置(0,0) [_u...
阅读全文
摘要://最简单-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ [NSObject cancelPreviousPerformRequestsWithTarget:self]; UITouch *touch = ...
阅读全文
摘要://// ViewController.m////// Created by 张艳锋 on 15/8/26.// Copyright (c) 2015年 张艳锋. All rights reserved.//#import "ViewController.h"#import "LBZPrefixHe...
阅读全文
摘要://非原创作为一种轻量级的数据交换格式,json正在逐步取代xml,成为网络数据的通用格式。有的json代码格式比较混乱,可以使用此“http://www.bejson.com/”网站来进行JSON格式化校验(点击打开链接)。此网站不仅可以检测Json代码中的错误,而且可以以视图形式显示json中的...
阅读全文
摘要:#import "ViewController.h"#import "DrawView.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UIImageView *imageView;- (IBAction)doTo...
阅读全文
摘要:// ViewController.m// IOS动画0817//// Created by 张艳锋 on 15/8/17.// Copyright (c) 2015年 张艳锋. All rights reserved.//#import "ViewController.h"@interface V...
阅读全文
摘要:文件结构application//#import "ViewController.h"#import "VideoViewController.h"#import "MovieViewController.h"@interface ViewController (){ //将类视图控制器设为全局变...
阅读全文
摘要://// ViewController.h// IOSUIGesterRrcognizer0813//// Created by scjy on 15/8/13.// Copyright (c) 2015年 scjy. All rights reserved.//#import @interface...
阅读全文
摘要:iOS开发UI篇—UITabBarController简单介绍一、简单介绍UITabBarController和UINavigationController类似,UITabBarController也可以轻松地管理多个控制器,轻松完成控制器之间的切换,典型的例子就是QQ、微信等应⽤。二、UITabB...
阅读全文
摘要:// ViewController.h// IOS310803//// Created by 张艳锋 on 15/8/3.// Copyright (c) 2015年 zyf. All rights reserved.//#import @interface ViewController : UIV...
阅读全文
摘要://非原创 看TableView的资料其实已经蛮久了,一直想写点儿东西,却总是因为各种原因拖延,今天晚上有时间静下心来记录一些最近学习的TableView的知识。下面进入正题,UITableView堪称UIKit里面最复杂的一个控件了,使...
阅读全文
摘要:1、我们的app一般默认的名字是我们的工程名字,所以我们一般会更改一个更加友好的名字,更改的方法如下图:找到InfoPlist.strings文件,在里面添加语句CFBundleDisplayName="你的APP的名字";2、关于怎么设置图标选中你的工程的名字(图上1位置),然后向下拉,找到APP...
阅读全文
摘要:#import @interface ViewController : UIViewController@end#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (voi...
阅读全文
摘要:#import "ViewController.h"#import @interface ViewController : UIViewController{ UILabel *lable; NSArray *array;}@end@interface ViewController ()@end...
阅读全文
摘要:#import @interface ViewController : UIViewController{ UILabel *lable;}@end#import "ViewController.h"@interface ViewController ()@end@implementation V...
阅读全文
摘要:#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {UIButton *button1=[UIButton buttonWithTyp...
阅读全文
摘要:[super viewDidLoad]; // 实例化UILabel并指定其边框 UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0.0, 80.0, 320.0, 300.0)]; // 设置label显示的文本 [lab...
阅读全文
摘要:#include #include #include void test(){//汉字输出 printf("THIS IS TEST\n"); printf("My age is %d\n",26); printf("My age is %4d 发现没?26前面多了两个空格\n",26); ...
阅读全文
摘要:#include #define sum 3+4//宏定义是原封不动的使用used for test4#include //used for test8~9#include //used for test8~9void test(){//数组输出 //int a[5]={1,2,3,4,5}; ...
阅读全文
摘要:#include #include #include int main(int argc, const char * argv[]) { // insert code here... printf("Hello, World!\n"); int a,b,i; { sran...
阅读全文
摘要:#include void test(){//1+2+3+4+.....+100 int a,b; a=0; b=0; for ( ; a#includeint main(){int n,i,k;printf("please enter a integer number:n=?");scan...
阅读全文
摘要:#include //输入输出头文件#include#include//局部被调用函数1 成绩检测void test(){ int b;printf("请输入你的成绩\n");scanf("%d",&b);if (b>=0&&b<=100) { printf("分数正常\n等待分析。。。\n"...
阅读全文
摘要://求两个函数中的较大者的MAX函数#include int main(int argc, const char * argv[]) { printf("input two nimbers\n"); int max(int x,int y); int a, b,c; scanf("%d,%d...
阅读全文
摘要:#import @interface AppDelegate : UIResponder { int k;}@property (strong, nonatomic) UIWindow *window;@end#import "AppDelegate.h"@interface AppDelegat...
阅读全文
摘要:#import @interface AppDelegate : UIResponder {@public NSInteger timeValue;}@property (strong, nonatomic) UIWindow *window;@end#import "AppDelegate.h"...
阅读全文
摘要://声明非原创步骤:1.打开Xcode,单机CreatanewXcodeproject2.左边选择ios下Application,右边选择singleviewApplication3.填写项目名称单机Next4.ViewController.h中定义成员和方法//// ViewController...
阅读全文
摘要://此作品非原创#import"ACViewController.h"@interfaceACViewController()@end@implementationACViewController- (void)viewDidLoad{[superviewDidLoad];// Do any add...
阅读全文
摘要://此处标明非原创实现iPhone漂亮的动画效果主要有两种方法, 一种是UIView层面的, 一种是使用CATransition进行更低层次的控制, 第一种是UIView,UIView方式可能在低层也是使用CATransition进行了封装,它只能用于一些简单的、常用的效果展现,这里写一个常用的示例...
阅读全文
摘要:1. 图片缩放:代码- (UIImage*)resizeImage:(UIImage*)image toWidth:(NSInteger)width height:(NSInteger)height{ // Create a graphics context with the target siz...
阅读全文
摘要://非原创UIProgressView顾名思义用来显示进度的,如音乐,视频的播放进度,和文件的上传下载进度等。下面以一个简单的实例来介绍UIprogressView的使用。@interfaceActivityViewController :UIViewController{ UIProgressVi...
阅读全文
摘要:UIActivityIndicatorView实例提供轻型视图,这些视图显示一个标准的旋转进度轮。当使用这些视图时,最重要的一个关键词是小。20×20像素是大多数指示器样式获得最清楚显示效果的大小。只要稍大一点,指示器都会变得模糊。iPhone提供了几种不同样式的UIActivityIndicato...
阅读全文
摘要:NSTimer是Cocoa中比较常用的定时器类,基本操作如下:handleTimer方法可以自行定义。在需要的地方创建timer即可,handleTimer就可以每0.5秒执行一次。- (void) handleTimer: (NSTimer *) timer{ //在这里进行处理}NSTimer ...
阅读全文
摘要://非原创iPhone Tableview分批显示数据是本文要介绍的内容,主要讲解的是数据的显示。iPhone屏幕尺寸是有限的,如果需要显示的数据很多,可以先数据放到一个table中,先显示10条,table底部有一察看更多选项,点击察看更多查看解析的剩余数据。基本上就是数据源里先只放10条, 点击...
阅读全文
摘要://非原创 UITableView是app开发中常用到的控件,功能很强大,多用于数据的显示。下面以一个简单的实例来介绍tableview的基本用法。(适合新手,高手飘过)@interfaceTableViewTestViewController :UIViewController{ UITable...
阅读全文
摘要://非原创UItextField通常用于外部数据输入,以实现人机交互。下面以一个简单的登陆界面来讲解UItextField的详细使用。//用来显示“用户名”的labelUILabel* label1 = [[UILabelalloc]initWithFrame:CGRectMake(15,65,70...
阅读全文
摘要://非原创UIbutton作为简单且频繁被使用的控件,其地位在整个app开发中不可小视。在IB中使用button相对来说很简单,很容易上手,但在多视图开发中button通常会被即时生成,并设置其属性和功能,即通过代码生成。如下是我对button的理解。//创建圆角button UIButton*b...
阅读全文
摘要:UIslider是一个方便的控件,让用户能够以可视化的方式设置指定范围内的值。和按钮一样,滑块也能响应事件,还可像文本框一样被读取。如果希望用户对滑块的调整立刻影响应用程序,则需要让他触发操作。UISlider *slider = [[UISlider alloc] initWithFrame:CG...
阅读全文
摘要://非原创当用户输入不仅仅是布尔值时,可使用分段控件(UISegmentedControl)。分段控件提供一栏按钮(有时称为按钮栏),但只能激活其中一个按钮。分段控件会导致用户在屏幕上看到的内容发生变化。它们常用于在不同类别的信息之间选择,或在不同的应用屏幕之间切换。下面介绍基本属性和基本方法的使用...
阅读全文