Просмотр исходного кода

Fix the last toolbar item not going all the way to the edge on iPad.

Since we round down to ensure integral sizes, we end up with a little extra space on the right at the end. Fix this by special casing the last toolbar item and making sure it goes to the right edge.
Ryan Olson лет назад: 12
Родитель
Сommit
b207b32abd
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      Classes/Explorer Toolbar/FLEXExplorerToolbar.m

+ 5 - 0
Classes/Explorer Toolbar/FLEXExplorerToolbar.m

@@ -113,6 +113,11 @@
         originX = CGRectGetMaxX(toolbarItem.frame);
     }
     
+    // Make sure the last toolbar item goes to the edge to account for any accumulated rounding effects.
+    UIView *lastToolbarItem = [self.toolbarItems lastObject];
+    CGRect lastToolbarItemFrame = lastToolbarItem.frame;
+    lastToolbarItemFrame.size.width = CGRectGetMaxX(self.bounds) - lastToolbarItemFrame.origin.x;
+    lastToolbarItem.frame = lastToolbarItemFrame;
     
     const CGFloat kSelectedViewColorDiameter = [[self class] selectedViewColorIndicatorDiameter];
     const CGFloat kDescriptionLabelHeight = [[self class] descriptionLabelHeight];