![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
基本控件的使用
文章平均质量分 52
ddeddd
这个作者很懒,什么都没留下…
展开
-
UIImagePickerController的一些属性(调照相机或者图片)
1.wpc1.导框架添加系统框架MobileCoreServices.framework头文件#import 遵守的协议UINavigationControllerDelegate,UIImagePickerControllerDelegate2.方法#pragma mark - 点击事件-(void)btnClick:(UIButton *)btn{原创 2015-03-25 19:26:13 · 308 阅读 · 0 评论 -
UISwipeGestureRecognizer (侧边栏)
- (void)creatSwipeGesture { UISwipeGestureRecognizer *swipeGestureRecognizerLeft = [[UISwipeGestureRecognizer alloc] init]; [swipeGestureRecognizerLeft addTarget:self action:@selector(gestur原创 2015-03-25 19:20:16 · 343 阅读 · 0 评论 -
基础控件(UISwitch_UISegmentControl)等
1.UISegmentedControl{ NSArray *arr = @[@"小黄",@"小红",@"屎壳郎"]; //分段控制器 事件驱动型 控件 UISegmentedControl *seg = [[UISegmentedControl alloc] initWithItems:arr]; //设置frame 默认是均匀分布宽度 seg.原创 2015-03-26 20:25:51 · 617 阅读 · 0 评论 -
NSNotationCenter通知
1.发送 /*观察者使用: 1.注册某个对象成为观察者 1.1任何NSObject(或其子类)的对象,都可以通过通知中心注册成为某条广播的观察者 1.2一条广播的观察者可以有多个 2.被观察的对象发送广播 --> 观察者可以接收到特定的广播 */ //点击按钮,通过通知中心发送广播 //1.原创 2015-03-25 19:57:11 · 323 阅读 · 0 评论 -
UITabBarController的一些属性
1.基本概念 //1.创建视图控制器(视图控制器,导航控制器)的对象 FirstViewController *vc0 = [[FirstViewController alloc]init]; //设置title和image //视图控制器的title属性可以同时设置tabBarItem的title和navigationItem的title vc0.title原创 2015-03-25 19:21:57 · 1062 阅读 · 0 评论 -
UIWindow的一些属性
1.基本概念//[UIScreen mainScreen] 获取当前设备的屏幕//[[UIScreen mainScreen] bounds] 获取屏幕的边框大小 //main 仍然是程序入口int main(int argc, char * argv[]){ @autoreleasepool { return UIApplicationMain原创 2015-03-25 19:02:01 · 374 阅读 · 0 评论 -
常见的程序的属性获取(版本号,bundle id 等)
NSString *version = [[[NSBundlemainBundle] infoDictionary]objectForKey:@"CFBundleShortVersionString"];原创 2015-07-31 09:05:11 · 712 阅读 · 0 评论 -
UIAlertView的基本用法
UIAlertView *alert = [[UIAlertViewalloc] initWithTitle:@"修改昵称"message:nildelegate:selfcancelButtonTitle:@"取消"otherButtonTitles:@"确定",nil]; alert.alertViewStyle =UIAlertViewSty原创 2015-08-18 15:41:42 · 286 阅读 · 0 评论 -
UIScrollView的一些属性
5.视图控制器的生命周期函数 - (void)dealloc{ NSLog(@"Root Dealloc"); [super dealloc];}//创建 视图控制器 调用init 函数的时候会自动调用//在initWithNibName函数 最好不要写self.view的操作 - (id)initWithNibName:(NSString *)ni原创 2015-03-25 19:06:29 · 1086 阅读 · 0 评论 -
UITableView的一些属性
1.基本概念 UITableViewStylePlain //Plain:普通视图 --> 默认只有一个分组 /* cell和cell.contentView //iOS7以前 --> 不区分 //iOS7以后,官方推荐的是所有的内容都要加在cell.contentView上 --> 否则有可能会出现错误 */原创 2015-03-25 19:24:06 · 499 阅读 · 0 评论 -
UIGesture的一些属性
1.单击-(void)createTapGesture{ //点击 //UITapGestureRecognizer:继承自手势基类UIGestureRecognizer UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector原创 2015-03-25 19:16:31 · 479 阅读 · 0 评论 -
UIView的生命周期
5.视图控制器的生命周期函数 - (void)dealloc{ NSLog(@"Root Dealloc"); [super dealloc];}//创建 视图控制器 调用init 函数的时候会自动调用//在initWithNibName函数 最好不要写self.view的操作 - (id)initWithNibName:(NSString *)ni原创 2015-03-25 19:04:49 · 334 阅读 · 0 评论 -
模态视图PresentRotation
-(void)btnClick:(UIButton *)btn{ DetailViewController *dvc = [[DetailViewController alloc]init]; if (btn.tag == 100) { //上下切换:默认切换方式 dvc.modalTransitionStyle = UIModalTrans原创 2015-03-25 19:54:17 · 292 阅读 · 0 评论 -
UINavigationBar和ToolBar的一些属性
1.基本概念常用 //设置信号栏的颜色(白色) [self.navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];//修改tabBar上的字的颜色 mtvc.tabBar.tintColor=[UIColor blueColor]; //UINavigationB原创 2015-03-25 19:12:23 · 591 阅读 · 0 评论 -
UITouch的一些属性(拼图)
1.移动label-(void)createLabel{ for (int i = 0; i 3; i++) { UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(110, 80 + 120*i, 100, 100)]; label.backgroundColor = [UIColo原创 2015-03-25 19:19:21 · 388 阅读 · 0 评论 -
AVAudioRecorder的一些属性(录音机)
1.导框架1.系统框架CoreAudio.frameworkAVFoundation.framework2.导头文件#import 3.遵守协议>{ AVAudioRecorder *_recoder; //录音}2.录音 //record //第一个参数:录音存放位置的字符串转化为的网址 NSString原创 2015-03-25 19:30:13 · 2116 阅读 · 0 评论 -
UIImage的一些属性
1.图片的拉伸效果http://www.cnblogs.com/heyonggang/archive/2013/12/19/3482733.html UIImage *together =[UIImage imageNamed:@"togetherGone"]; together = [together resizableImageWithCapInsets:UIEdgeI原创 2015-03-25 19:10:58 · 297 阅读 · 0 评论 -
AVAudioPlayer的一些属性(音乐播放器)
1.导框架#import 2.创建对象{ AVAudioPlayer *_audioPlayer; //音乐播放器对象}3.播放/暂停/停止//play //AVAudioPlayer:音乐播放器 //需要添加系统的框架AVFoundation.framework if (_audioPlayer ==原创 2015-03-25 19:28:55 · 577 阅读 · 0 评论 -
UIViewController的一些属性(CATrasition转场动画)
1.基本概念 //1.把svc添加为当前视图控制器的子视图控制器 [self addChildViewController:svc]; [svc release]; //2.查看当前视图控制器的子视图控制器 --> 数组 NSArray *childArr = self.childViewControllers; NSLog(@原创 2015-03-25 19:17:44 · 426 阅读 · 0 评论 -
UIButton的一些属性
1.可以设置图片和文字的偏移位置 [button setTitleEdgeInsets:UIEdgeInsetsMake(30, -70, 0, 0)]; [button setImageEdgeInsets:UIEdgeInsetsMake(-10, 0, 0, 0)]; 2. setBackgroundImage和setImage的区别 //setBackgroundIm原创 2015-03-25 18:57:50 · 336 阅读 · 0 评论 -
UITextField的一些属性
1.基本概念 //7.设置水平方向文本对齐方式:默认左对齐 textField0.textAlignment = NSTextAlignmentCenter; //8.设置竖直方向文本对齐方式:默认是center [textField0 setContentVerticalAlignment:UIControlContentVerticalAlignmentCen原创 2015-03-25 19:09:19 · 364 阅读 · 0 评论 -
UICollectionView的一些属性
1.注册UICollectionView以及类似于tableView的组头之类的东西 http://www.cnblogs.com/wayne23/p/4013522.html [_collectionView registerNib:[UINib nibWithNibName:@"BBSCell" bundle:nil] forCellWithReuseIdentifier:@"BB原创 2015-03-25 19:14:04 · 378 阅读 · 0 评论 -
UIImageView的一些属性
1.基本概念 [self setExclusiveTouch:YES];//只能点一个 //设置window的背景 用图片进行配色 //要保证图片的大小和 视图的frame一样大 self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"back2.jp原创 2015-03-25 19:00:22 · 373 阅读 · 0 评论