UIView、UIResponder、UIAlertView、UIActionSheet
2016-03-12 18:12
423 查看
code
通用
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; [_window release]; ViewController *vc = [[ViewController alloc] init]; self.window.rootViewController = vc; [vc release]; return YES; } - (void)dealloc { [_window release]; [super dealloc]; }
UINavigationController的通用代码
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [self.window makeKeyAndVisible]; [_window release]; ViewController *vc = [[ViewController alloc] init]; UINavigationController *naVC = [[UINavigationController alloc] initWithRootViewController:vc]; self.window.rootViewController = naVC; [naVC release]; [vc release]; return YES; } - (void)dealloc { [_window release]; [super dealloc]; }
UIView
动画
// 从原来的位置移到新的位置,与原来的大小没有关系[UIView animateWithDuration:5.5 animations:^{ myView.frame = CGRectMake(50, 50, 70, 70); }];
property
hiddenself.automaticallyAdjustsScrollViewInsets
是ViewController的属性,作用于第一个滚动视图,默认YES,作用就是让滚动视图自动去适应尺寸
UIAlertView
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"提醒" message:@"鼠标点击了" delegate:self cancelButtonTitle:@"好的" otherButtonTitles:@"哈哈", nil]; myAlertView.alertViewStyle = UIAlertViewStyleSecureTextInput; [myAlertView show]; [myAlertView release];
UIActionSheet
UIActionSheet *myActionSheet = [[UIActionSheet alloc] initWithTitle:@"Actions" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"删除" otherButtonTitles:@"猜", nil]; myActionSheet.myActionSheetStyle = UIActionSheetStyleDefault; [myActionSheet showInView: self.view]; [myActionSheet release];
UIResponder
Method
resignFirstResponderbecomeFirstResponder
ViewController初始化顺序
-(id)initWithNibName:bundle:-(void)loadView
-(void)viewDidLoad
-(void)viewWillAppear, viewDidAppear, viewWillDisappear, viewDidDisappear
相关文章推荐
- MATLBA GUI设计之按钮之间的数据传递
- HDU 5288 OO’s Sequence 水题
- UILabel
- API Guides(八)—— Audio Capture To Media Playback
- 226. Invert Binary Tree My Submissions Question
- Easyui-Combobox多选下拉框
- 【Java】容器类学习之路(二)Collection详解:List、Set和Queue
- UILabel补充
- jsp跳转getRequestDispatcher()和sendRedirect()的区别
- Android Stuido第五期 - 时间选择器
- iOS UIView自带动画和核心动画
- CodeForces 450B Jzzhu and Sequences
- 控件-UILabel
- [leetcode 250]Count Univalue Subtrees ------元素都相同的子树个数
- 用requestDisallowInterceptTouchEvent()方法防止viewpager和子view滑动事件冲突
- CodeForces 622A:Infinite Sequence【排列】
- Java中String、StringBuilder以及StringBuffer
- UESTC 1144 Big Brother 二分图、最大匹配
- Uva1151——Buy or Build && POJ2784——Buy or Build
- Android子线程真的不能更新UI么