كيفية الحصول على تطبيق Application ناقص ارتفاع uinavigationBar؟

StackOverflow https://stackoverflow.com/questions/3644352

سؤال

أضع هذا في LoadView وهو يعمل:

CGRect navFrame = [[UIScreen mainScreen] applicationFrame];
navFrame.size.height -= self.navigationController.navigationBar.frame.size.height;
UIImageView *imageView = [[UIImageView alloc] initWithFrame:navFrame];

ولكن هل هناك متغير مثل ApplicationFrame يمنح Applicationframe ناقصًا على ارتفاع UinavigationBar؟

هل كانت مفيدة؟

المحلول

يبدو أنه لا يوجد منذ ثلاثة 20 عامًا يفعل شيئًا مشابهًا لما فعلته. في TTGlobalNavigatorMetrics.m, ، إنهم يفعلون:

CGRect TTNavigationFrame() {
  CGRect frame = [UIScreen mainScreen].applicationFrame;
  return CGRectMake(0, 0, frame.size.width, frame.size.height - TTToolbarHeight());
}

http://github.com/facebook/three20/blob/master/src/three20uinavigator/sources/ttglobalnavigatormetrics.m#l53

غير لامع

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top