基础UI
文章平均质量分 53
一纸小城
这个作者很懒,什么都没留下…
展开
-
UITextField 常用操作
1.创建01.UITextField* myTextField = [[UITextField alloc]initWithFrame:CGRectMake(50, 100, 200, 50)]; 2.设置委托01.myTextField.delegate = self;//委托类需要遵守UITextFieldDelegate协议 3.设置属性UIControl属性对U转载 2014-03-24 15:17:35 · 282 阅读 · 0 评论 -
UISwitch常用方法
一、第一种创建UISwitch控件的方法,在代码中动态创建。1、打开Xcode 4.3.2, 新建项目Switch,选择Single View Application。2、打开ViewController.m文件在viewDidLoad方法里添加代码:[cpp] view plaincopy- (void)viewDidLoad { [super转载 2014-03-24 15:57:01 · 418 阅读 · 0 评论 -
UIImageView 常用操作
UIImageView,顾名思义,是用来放置图片的。使用Interface Builder设计界面时,当然可以直接将控件拖进去并设置相关属性,这就不说了,这里讲的是用代码。1、创建一个UIImageView:创建一个UIImageView对象有五种方法:UIImageView *imageView1 = [[UIImageView alloc] init];UIImag转载 2014-03-24 15:05:23 · 282 阅读 · 0 评论 -
UIButton常用操作
第一、UIButton的定义 UIButton *button=[[UIButton buttonWithType:(UIButtonType);能够定义的button类型有以下6种, typedef enum { UIButtonTypeCustom = 0, 自定义风格 UIButtonTypeRoundedRect, 圆角矩形 UIButtonTyp转载 2014-03-24 15:10:09 · 301 阅读 · 0 评论 -
UILabel常用操作
UILabel 的常见属性和方法://创建UIlabel对象UILabel* label = [[UILabel alloc] initWithFrame:self.view.bounds];//设置显示文本label.text = @"This is a UILabel Demo,";//设置文本字体label.font = [UIFo转载 2014-03-24 15:19:04 · 322 阅读 · 0 评论 -
ios 分段控件 UISegmentedControl常用操作
分段控件是我们常用的控件之一,今天把具体用法总结了下: 1.初始化UISegmentedControl[plain] view plaincopyNSArray *segmentedArray = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil]; UISegmentedControl转载 2014-03-24 15:36:33 · 502 阅读 · 0 评论 -
UISeachBar 常用方法
当你在seachBar中输入字母之前的时候,只是用鼠标选中searchBar的时候,如图终端输出截图如下:(这个时候调用先shouldBeginEditing,之后调用didBeginEditing,)当你希望选中UISearchBar的时候,键盘自动调用加载到界面,你需要将下面函数的返回值设置为YES;- (BOOL)searchBarShouldBeginEditing:(转载 2014-03-24 15:51:13 · 929 阅读 · 0 评论 -
UIPageControl 常用方法
- (void)viewDidLoad{ [superviewDidLoad]; self.view.backgroundColor = [UIColorcolorWithPatternImage:[UIImageimageNamed:@"bg_blank.png"]]; // self.view.backgroundColor = [UIColor clearCo转载 2014-03-24 15:47:01 · 404 阅读 · 0 评论