![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
IOS基本控件
yuruiiou
这个作者很懒,什么都没留下…
展开
-
UILabel
UILabelUILabelcode文本中间对齐圆角边框propertyMethodcode文本中间对齐UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 150, 35)];myLabel.text = @"This is a Label";myLabel.textAlignment = NST原创 2016-03-12 17:58:36 · 245 阅读 · 0 评论 -
UISlider、UIStepper、UISegmentControl、UISwitch、UIProgressView、UIActivityIndicatorView
codeUISlider UISlider *mySlider = [[UISlider alloc] initWithFrame:CGRectMake(80, 100, 250, 35)]; [self.view addSubview: mySlider]; [mySlider release]; [mySlider addTarget:self action:@se原创 2016-03-13 11:04:34 · 247 阅读 · 0 评论 -
事件和手势
code让视图跟着手指移动- (void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches withEvent:event]; // 获取触摸点的坐标// NSLog(@"%@", touches); // 1.先获取to原创 2016-03-13 09:56:42 · 216 阅读 · 0 评论 -
UINavigationController, UITabBarController
code通用AppDelegate.h#import "ViewController.h" self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; [self.window makeKeyAndVisible]; [_window release]; ViewCont原创 2016-03-13 12:23:38 · 224 阅读 · 0 评论 -
UIImagePickerController, UISearchBar
codeUIImagePickerController1.签协议 2.某个 Button 的方法里{ UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.allowsEditing = YES; picker.delegate = self;原创 2016-03-27 14:11:17 · 197 阅读 · 0 评论 -
UITableViewController
codeApp.m self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; [self.window makeKeyAndVisible]; [_window release]; // UITableViewController的创建 MyTableViewCo原创 2016-03-18 08:06:58 · 238 阅读 · 0 评论 -
UITableView
codeproperty原创 2016-03-15 08:21:03 · 297 阅读 · 0 评论 -
UIView、UIResponder、UIAlertView、UIActionSheet
Methodcode动画// 从原来的位置移到新的位置,与原来的大小没有关系[UIView animateWithDuration:5.5 animations:^{ myView.frame = CGRectMake(50, 50, 70, 70); }];原创 2016-03-12 18:12:51 · 210 阅读 · 0 评论 -
UITextField
code圆角,有占位符 UITextField *myTextField = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 190, 30)]; myTextField.borderStyle = UITextBorderStyleRoundedRect; myTextField.placeholder = @"原创 2016-03-12 19:14:26 · 275 阅读 · 0 评论 -
相册,循环滚动,可缩放
#import "ViewController.h"#define HEIGHT 400#define WIDTH self.view.frame.size.width@interface ViewController ()<UIScrollViewDelegate>@property(nonatomic, retain)UIScrollView *scrollView;@property原创 2016-03-13 12:30:24 · 238 阅读 · 0 评论 -
毛玻璃效果
code毛玻璃效果 UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; UIVisualEffectView *visualView = [[UIVisualEffectView alloc] initWithEffect: blur]; visualView.frame = s原创 2016-03-13 11:24:43 · 265 阅读 · 0 评论 -
跳转
code按Button进行模态跳转// 在当前m中引入目标页面h文件- (void) click: (UIButton *) button{ // 模态跳转 // 1、创建目标页面的对象 SecondViewController *secVC = [[SecondViewController alloc] init]; // 2、设置跳转的动画样式 secVC原创 2016-03-12 21:54:27 · 211 阅读 · 0 评论 -
Label_TextField_自定义视图
LTView.h@interface LTView : UIView <UITextFieldDelegate>@property (nonatomic, retain) UILabel *myLabel;@property (nonatomic, retain) UITextField *myTextField;@endLTView.m#import "LTView.h"@implementa原创 2016-03-12 21:30:33 · 260 阅读 · 0 评论 -
UIImage
code图片,和灰色边界的原型图片 UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; [self.view addSubview: myImageView]; [myImageView release]; myImageView.i原创 2016-03-12 21:11:59 · 173 阅读 · 0 评论 -
UIButton
codeUIButtonTypeSystem型,默认蓝色UIButton *myButton = [UIButton buttonWithType:UIButtonTypeSystem];myButton.frame = CGRectMake(100, 200, 150, 50);[myButton setTitle: @"MyButton" forState: UIControlStateNo原创 2016-03-12 18:58:42 · 196 阅读 · 0 评论 -
UIScrollView、UIPageControl、NSTimer
UIScrollViewcode// 宽度为屏幕宽度9倍的UIScrollView UIScrollView *myScrollView = [[UIScrollView alloc] initWithFrame: self.view.frame]; myScrollView.backgroundColor = [UIColor lightGrayColor]; myScrol原创 2016-03-13 11:53:38 · 258 阅读 · 0 评论