UIView - iPhone Development Wiki
来源:互联网 发布:游戏脚本python 编辑:程序博客网 时间:2024/06/05 14:42
http://www.iphonedevwiki.net/index.php/UIView
UIView
UIView is the root class of all UI elements.
Contents
[hide]- 1 Getting View Hierarchy Info
- 1.1 -recursiveDescription
- 1.2 -scriptingInfoWithChildren
- 2 Animation Blocks
- 3 frame and bounds
- 4 References
Getting View Hierarchy Info
There are 2 ways of getting the view hierarchy info, the "human readable" -[UIView recursiveDescription] and "machine readable" -[UIView scriptingInfoWithChildren].
-recursiveDescription
Returns the description of the view and its subviews.
Example output:
<UIWebView: 0x4116bb0; frame = (0 100; 320 230); layer = <CALayer: 0x4116c20>> <UIScroller: 0x411e110; frame = (0 0; 320 230); clipsToBounds = YES; autoresize = H; layer = <CALayer: 0x411e4d0>> <UIImageView: 0x411f460; frame = (0 0; 54 54); transform = [-1, 0, -0, -1, 0, 0]; alpha = 0; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x411f490>> <UIWebDocumentView: 0x4812c00; frame = (0 0; 320 230); layer = <UIWebLayer: 0x41171c0>>
-scriptingInfoWithChildren
This function returns an NSDictionary with contains some information e.g. geometry, class name, etc.
Animation Blocks
Animation blocks are implemented by the UIViewAnimationState class with the following correspondences:
[__currentViewAnimationState->_delegate release];
__currentViewAnimationState->_delegate = [delegate retain];
}[UIView setAnimationWillStartSelector:selector];__currentViewAnimationState->_willStartSelector = selector;[UIView setAnimationDidStopSelector:selector];__currentViewAnimationState->_didEndSelector = selector;[UIView setAnimationDuration:duration];__currentViewAnimationState->_duration = duration;[UIView setAnimationDelay:delay];__currentViewAnimationState->_delay = delay;[UIView setAnimationCurve:curve];__currentViewAnimationState->_curve = curve;[UIView setAnimationRepeatCount:repeatCount];__currentViewAnimationState->_repeatCount = repeatCount;[UIView setAnimationRepeatAutoreverses:autoreverses];__currentViewAnimationState->_autoreverses = autoreverses;[UIView setAnimationBeginsFromCurrentState:value];__currentViewAnimationState->_useCurrentLayerState = value;[UIView setAnimationTransition:transVal forView:containercache:cache];__currentViewAnimationState->_transition = transVal;
__currentViewAnimationState->_transitionView = [container retain];
__currentViewAnimationState->_cacheTransition = cache;[UIView areAnimationsEnabled];__animate;
In above, __currentViewAnimationState is a global variable, which is a UIViewAnimationState. This value is automatically updated after calling+pushViewAnimationState:context: and +popAnimationState. NULL checks were omitted in the above codes for simplicity.
There are also a few undocumented methods:
__currentViewAnimationState->_filterView = [view retain];[UIView _setAnimationFilterValue:value];[2]__currentViewAnimationState->_filterValue = value;
There are also a few equivalent (probably deprecated) selectors:
frame and bounds
frame and bounds are both properties of a UIView. When the view's transform is not identity, the only difference between them is the origin of bounds is always zero.
When transform is not identity, the SDK documentation warns that frame is undefined:
“Warning: If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.”but this is not completely true — the frame is actually the rectangle enclosing the transformed view.
These properties are actually proxies to the corresponding ones of CALayer. However, while the bounds (and center) is an internal property, frame incurs a transactional lock (spin lock) and an affine transform.
References
- ↑ +_isInAnimationBlock was named as +_pendingAnimations prior to 3.2
- ↑ 2.0 2.1 2.2 These methods are available since 3.2.
- Official documentation: UIView
- Header: http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UIView2.h
- UIView - iPhone Development Wiki
- iPhone UIView
- iPhone development folders
- iOS-iPhone-Development
- [iPhone] UIView FAQ
- iPhone-UIView 讲解
- Iphone中的UIView开发
- iPhone UIView 详解
- iphone UIView 详解
- iPhone Development Tutorial/Reference Links
- My Roadmap to iPhone Development
- Unity iPhone Game Development tricks
- SBJson framwork for iphone development
- HeadFirst iPhone and iPad Development
- [IPhone] UIView与内存管理
- IPhone之UIView中动画
- IPhone之UIView中动画
- iphone--UIView翻转效果实现
- iTween 曲线移动
- C#中子线程操作主线程中窗体上控件的方法
- 几种经典的网络服务器架构
- &&
- 程序员技术练级攻略
- UIView - iPhone Development Wiki
- 基于XMPP的IOS聊天客户端程序(IOS端一)
- Access restriction: The method getCombiningClass(int) from the type Normalizer is not accessible due
- 对深拷贝与浅拷贝的再次理解
- 【cocos2D-x学习】6.简单游戏的框架——扫雷V0.1
- undefined reference to `executor_globals_id'
- secureCRT 快捷键
- 基于XMPP的IOS聊天客户端程序(IOS端二)
- nyist-33