2013年4月20日
摘要: 效果图在storyborad中添加的视图Navigation Controller(把table view的Content设为Static Cells),View Controller(+scroll view),文件:在BIDViewController.h//// BIDViewController.h// scrollView//// Created by jxy on 13-4-19.// Copyright (c) 2013年 jxy. All rights reserved.//#import <UIKit/UIKit.h>#import <Foundation/ 阅读全文
posted @ 2013-04-20 17:02 蒋晓宇 阅读(781) 评论(2) 推荐(0) 编辑
摘要: UITextField的父类UIControlUITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; //初始化textfield并设置位置及大小text.borderStyle = UITextBorderStyleRoundedRect; //设置边框样式,只有设置了才会显示边框样式 typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleBezel,... 阅读全文
posted @ 2013-04-20 11:09 蒋晓宇 阅读(483) 评论(0) 推荐(0) 编辑
摘要: UIKit提供了一组控件:UISwitch开关、UIButton按钮、UISegmentedControl分段控件、UISlider滑块、UITextField文本字段控件、UIPageControl分页控件。控件是对UIView派生类的实用增强及补充,并可以直接附着于导航栏、表格单元,甚至更大的对象。这些控件的基类均是UIControl,而UIControl派生自UIView类,所以每个控件都有很多视图的特性,包括附着于其他视图的能力。所有控件都拥有一套共同的属性和方法。所以学习控件,我们先学习UIControl属性enabled控件默认是启用的。要禁用控件,可以将enabled属性设置为N 阅读全文
posted @ 2013-04-20 11:03 蒋晓宇 阅读(408) 评论(0) 推荐(0) 编辑
摘要: UIButton得父类UIControl1)创建UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 风格有如下typedef enum { UIButtonTypeCustom = 0, // 自定义,无风格 UIButtonTypeRoundedRect, // 白色圆角矩形,类似偏好设置表格单元或者地址簿卡片 UIButtonTypeDetailDisclosure, //蓝色的披露按钮,可放在任何文字旁 ... 阅读全文
posted @ 2013-04-20 10:59 蒋晓宇 阅读(309) 评论(0) 推荐(0) 编辑
摘要: UIView表示屏幕上的一块矩形区域,它在App中占有绝对重要的地位,因为IOS中几乎所有可视化控件都是UIView的子类。负责渲染区域的内容,并且响应该区域内发生的触摸事件UIView的功能1.管理矩形区域里的内容2.处理矩形区域中的事件3.子视图的管理 4.还能实现动画 UIView的子类也具有这些功能下图就是视图的内层次 1)三个结构体CGPoint、CGSize、CGRect1. CGPointstruct CGPoint { CGFloat x; CGFloat y; }; typedef struct CGPoint CGPoi... 阅读全文
posted @ 2013-04-20 10:50 蒋晓宇 阅读(684) 评论(0) 推荐(0) 编辑
摘要: 这些是在CGGeometry.h里的CGPoint、CGSize、CGRect、CGRectEdge实际上都是结构体struct CGPoint { CGFloat x; CGFloat y;};typedef struct CGPoint CGPoint; struct CGSize { CGFloat width; CGFloat height;};typedef struct CGSize CGSize;struct CGRect { CGPoint origin; CGSize size;};typedef struct CGRect CGRect;enum CGRectE... 阅读全文
posted @ 2013-04-20 10:40 蒋晓宇 阅读(795) 评论(0) 推荐(0) 编辑
摘要: UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(20, 40, 280, 80)]; //创建uilabellabel.backgroundColor = [UIColor grayColor]; //设置背景色label.tag = 91; //设置taglabel.text = @"Hello World"; //设置内容label.font = [UIFont fontWithName:@"Arial" size:30]; //设置内容字体和字体大小label.adjustsFon 阅读全文
posted @ 2013-04-20 10:28 蒋晓宇 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 在.h文件中声明:@interface ProtocolViewController :UIViewController<UITextViewDelegate>{ UITextView *textView; }@property (nonatomic,retain)UITextView *textView;@end或UITextView *textView = [[UITextViewalloc]initWithFrame:CGRectMake(0, 275, 320, 224)];在.m中初始化:self.textView=[[[UITextView alloc] ini... 阅读全文
posted @ 2013-04-20 08:48 蒋晓宇 阅读(425) 评论(0) 推荐(0) 编辑