ios怎么nslog frame
1个回答
展开全部
frame里是四个float类型的数字, 分别是x, y, 宽, 高. 比如一个UIView的frame
UIView *theView = [[UIView alloc] initWithFrame:CGRectMake(10, 20, 100, 200)]; NSLog(@"frame: x = %f, y = %f, width = %f, height = %d", theView.frame.origin.x, theView.frame.origin.y, theView.frame.size.width, theView.frame.size.height);
UIView *theView = [[UIView alloc] initWithFrame:CGRectMake(10, 20, 100, 200)]; NSLog(@"frame: x = %f, y = %f, width = %f, height = %d", theView.frame.origin.x, theView.frame.origin.y, theView.frame.size.width, theView.frame.size.height);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询