我正在尝试调整框架。我有两个常量定义为浮点数 -viewTotalHeightExpanded
和viewTotalHeight
. 我将两者相减得到differenceY
.
CGFloat differenceY = viewTotalHeightExpanded - viewTotalHeight;
NSLog(@"viewTotalHeightExpanded = %f", viewTotalHeightExpanded);
NSLog(@"viewTotalHeight = %f", viewTotalHeight);
NSLog(@"differenceY = %f", differenceY);
日志内容如下:
2013-08-24 12:30:48.305 WS[25737:c07] viewTotalHeightExpanded = 406.000000
2013-08-24 12:30:48.305 WS[25737:c07] viewTotalHeight = 366.000000
2013-08-24 12:30:48.306 WS[25737:c07] differenceY = 680.000000
为什么differenceY
不是40?
编辑
这是如何定义的viewTotalHeight
:viewTotalHeightExpanded
#define likeBarHeight 20.0f
#define viewTotalHeight likeBarY+likeBarHeight+sortBarHeight
所有其他链式常量,例如likeBarY
和sortBarHeight
被定义为类似于likeBarHeight
.