material-components-ios icon indicating copy to clipboard operation
material-components-ios copied to clipboard

[Tabs] FlowLayout warnings in console for TabBarViewController

Open romoore opened this issue 8 years ago • 7 comments

Overview

On both iPhone 4s (iOS 8.3) and iPhone X (iOS 11), loading the TabBarViewController example in the MDC Catalog results in a console warning about the tabbar cells having the wrong sizes.

2017-09-14 23:01:23.163988+0900 MDCCatalog[16012:155007] The behavior of the UICollectionViewFlowLayout is not defined because:
2017-09-14 23:01:23.164110+0900 MDCCatalog[16012:155007] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2017-09-14 23:01:23.164503+0900 MDCCatalog[16012:155007] The relevant UICollectionViewFlowLayout instance is <MDCItemBarFlowLayout: 0x7fdf9534ad80>, and it is attached to <UICollectionView: 0x7fdf960b1600; frame = (0 0; 375 72); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x600000453e90>; layer = <CALayer: 0x600000428840>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}> collection view layout: <MDCItemBarFlowLayout: 0x7fdf9534ad80>.

Reproduction steps

  1. Open MDC Catalog → Tab Bar → TabBarViewController
  2. Check the Xcode console

Version number

34.0.2

Operating system and device

iPhone 4s/iOS 8.3 (Simulator), iPhone X/iOS 11 (Simulator)

Internal issue: b/37901472


Internal data

romoore avatar Sep 14 '17 14:09 romoore

Same issue here

patrikqvarnstrom avatar Oct 05 '17 08:10 patrikqvarnstrom

Having the same issue. Were you able to find a workaround?

alwhitehead avatar Oct 21 '17 18:10 alwhitehead

Any workaround for this found?

shahmharsh avatar Aug 06 '18 06:08 shahmharsh

The internal issue is not yet closed, re-opening this issue. Googler: please check the state of the internal issue and update it accordingly.

jverkoey avatar Sep 06 '18 15:09 jverkoey

The internal issue b/37901472 is now closed. This issue is being closed as a result.

material-mirror avatar Jul 30 '19 15:07 material-mirror

I still have the same problem on IphoneXr (IOS12.2) Using MaterialComponents (96.0.0)

In my case, I have a simple MDCTabBar with 3 TabBarItem.

I notice that if I do this

notificationVC.tabBarItem = UITabBarItem(title: "Notification", image: nil, tag: 3)

instead of

notificationVC.tabBarItem = UITabBarItem(title: "Notification", image: UIImage(...), tag: 3)

The warning goes away. Here is the full logs:

2019-12-13 14:49:33.829451-0500 Nightingale-proto-2[65468:15503013] The behavior of the UICollectionViewFlowLayout is not defined because:
2019-12-13 14:49:33.829472-0500 Nightingale-proto-2[65468:15503013] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2019-12-13 14:49:33.829610-0500 Nightingale-proto-2[65468:15503013] The relevant UICollectionViewFlowLayout instance is <MDCItemBarFlowLayout: 0x14de52e10>, and it is attached to <UICollectionView: 0x14f015800; frame = (0 0; 414 72); gestureRecognizers = <NSArray: 0x282c39ef0>; layer = <CALayer: 0x282299fe0>; contentOffset: {0, 0}; contentSize: {414, 72}; adjustedContentInset: {0, 0, 0, 0}> collection view layout: <MDCItemBarFlowLayout: 0x14df59990>.
2019-12-13 14:49:33.829624-0500 Nightingale-proto-2[65468:15503013] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2019-12-13 14:49:33.830191-0500 Nightingale-proto-2[65468:15503013] The behavior of the UICollectionViewFlowLayout is not defined because:
2019-12-13 14:49:33.830203-0500 Nightingale-proto-2[65468:15503013] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2019-12-13 14:49:33.830251-0500 Nightingale-proto-2[65468:15503013] The relevant UICollectionViewFlowLayout instance is <MDCItemBarFlowLayout: 0x14de54ed0>, and it is attached to <UICollectionView: 0x14f015800; frame = (0 0; 414 72); gestureRecognizers = <NSArray: 0x282c39ef0>; layer = <CALayer: 0x282299fe0>; contentOffset: {0, 0}; contentSize: {414, 72}; adjustedContentInset: {0, 0, 0, 0}> collection view layout: <MDCItemBarFlowLayout: 0x14de52e10>.
2019-12-13 14:49:33.830264-0500 Nightingale-proto-2[65468:15503013] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2019-12-13 14:49:33.832102-0500 Nightingale-proto-2[65468:15503013] The behavior of the UICollectionViewFlowLayout is not defined because:
2019-12-13 14:49:33.832115-0500 Nightingale-proto-2[65468:15503013] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2019-12-13 14:49:33.832160-0500 Nightingale-proto-2[65468:15503013] The relevant UICollectionViewFlowLayout instance is <MDCItemBarFlowLayout: 0x14de55590>, and it is attached to <UICollectionView: 0x14f015800; frame = (0 0; 414 72); gestureRecognizers = <NSArray: 0x282c39ef0>; layer = <CALayer: 0x282299fe0>; contentOffset: {0, 0}; contentSize: {414, 72}; adjustedContentInset: {0, 0, 0, 0}> collection view layout: <MDCItemBarFlowLayout: 0x14de54ed0>.
2019-12-13 14:49:33.832170-0500 Nightingale-proto-2[65468:15503013] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2019-12-13 14:49:33.832824-0500 Nightingale-proto-2[65468:15503013] The behavior of the UICollectionViewFlowLayout is not defined because:
2019-12-13 14:49:33.832835-0500 Nightingale-proto-2[65468:15503013] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2019-12-13 14:49:33.832881-0500 Nightingale-proto-2[65468:15503013] The relevant UICollectionViewFlowLayout instance is <MDCItemBarFlowLayout: 0x14de55590>, and it is attached to <UICollectionView: 0x14f015800; frame = (0 0; 414 56); gestureRecognizers = <NSArray: 0x282c39ef0>; layer = <CALayer: 0x282299fe0>; contentOffset: {0, 0}; contentSize: {414, 72}; adjustedContentInset: {0, 0, 0, 0}> collection view layout: <MDCItemBarFlowLayout: 0x14de55590>.
2019-12-13 14:49:33.832891-0500 Nightingale-proto-2[65468:15503013] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

Also, the problem seems to not be device-specific. I tested on an Iphone8 (IOS 12.2) and the same warning showed up.

velociraptor111 avatar Dec 13 '19 19:12 velociraptor111

Material Components 121.0.0 and iPhone Xs has this issue as well

henrikix avatar Feb 03 '21 07:02 henrikix