UI 常用方法总结之--- UIWindow UIView (不断更新中)
来源:互联网 发布:软件风格 编辑:程序博客网 时间:2024/06/05 11:45
UIWindow (UIView)
1.创建一个uiwindow对象
self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];
2.backgroundColor
背景颜色
3.- (void)makeKeyAndVisible;
eg: [self.windowmakeKeyAndVisible];
设置这个window为主windows,并使其可见
4.rootViewController
把一个视图控制器指定为windows的根视图控制器
eg:self.window.rootViewController = mainVC;
UIView :UIResponder <NSCoding,UIAppearance,UIAppearanceContainer,UIDynamicItem,UITraitEnvironment,UICoordinateSpace>
1.创建一个UIView对象
UIView *view = [[UIViewalloc]initWithFrame:CGRectMake(150,150, 55,55)];
2.backgroundColor
背景颜色
3.- (void)addSubview:(UIView *)view;
eg:[self.windowaddSubview:view];
添加一个view到self.window上
4.- (void)bringSubviewToFront:(UIView *)view;
eg:[self.windowbringSubviewToFront:view];
将一个View放到最前面
5.- (void)sendSubviewToBack:(UIView *)view;
[self.windowsendSubviewToBack:view];
将一个view放到后面
6.- (void)removeFromSuperview;
eg:[view removeFromSuperview];
将某个view从父视图移除
注意:调用该方法 会使得自己引用计数-1 如果 view上还有view 一并移除掉
7.alpha
透明度 (0 - 1float)带着所有子视图透明度一起改变
eg:View.alpha =0.3;
8.hidden
隐藏(YES隐藏 / NO显示)
view.hidden = YES;
9.superview
eg:NSLog(@"view的父视图:%@“,view.superview);
10.subviews
eg:NSLog(@“view的子视图:%@“,view.subviews);
11.tag
eg:view.tag = 10000;
给view加一个编号,方便父视图查找某个子视图
12.- (UIView *)viewWithTag:(NSInteger)tag;
- UI 常用方法总结之--- UIWindow UIView (不断更新中)
- UI 常用方法总结之--- UILabel UITextField (不断更新中)
- UI 常用方法总结之--- UIButton UIAlertView (不断更新中)
- UI 常用方法总结之--- UIViewController UIResponder (不断更新中)
- UI 常用方法总结之--- UIImageView UISlider UISegmentedControl (不断更新中)
- UI 常用方法总结之---各个手势种类 (不断更新中)
- UI 常用方法总结之--- UIScrollView (不断更新中)
- UI 常用方法总结之--- UIPageControl (不断更新中)
- UI 常用方法总结之--- UINavigationController (不断更新中)
- UI 常用方法总结之--- UITableView (不断更新中)
- UI基础之UIview,UILabel,UIWindow
- UI基础UIWindow、UIView
- UI/UIWindow/UIView
- UI- UIWindow & UIView
- UI- UIWindow & UIView
- iOS学习总结之UI框架UIWindow和UIView(附带计时器学习)
- UI 第一节复习 UIWindow UIView
- iOS-UI-01 UIWindow UIView
- String.Empty、string=”” 和null的区别
- Linux sqlite3基本命令
- 32位16位8位寄存器及编号
- 在EditPlus中配置PHP调试
- Codeforces 475B Strongly Connected City 强连通裸题
- UI 常用方法总结之--- UIWindow UIView (不断更新中)
- 素数距离问题
- 一个帖子学会Android四大组件
- cocos2dx面试题-第二波
- 共轭梯度法(Conjugate Gradient Methods-CG)在回归分析的应用和比较
- [Leetcode] Permutations
- Struts是怎么运行的?
- “短线神刀”李旭东投资简历
- ACM-贪心策略