【发布时间】:2015-12-14 18:03:21
【问题描述】:
我使用以下代码创建UIRefreshControl:
_refreshControl = new UIRefreshControl();
_refreshControl.ValueChanged += RefreshTriggered;
_collectionView.InsertSubview(_refreshControl, 0);
而且我不知道为什么UIRefreshControl 会覆盖UICollectionViewCells。
这是我刚刚添加刷新控件时UICollectionView 的子视图:
[0]: {<UIRefreshControl: 0x7c132fe0; frame = (0 0; 594 60); hidden = YES; autoresize = W; layer = <CALayer: 0x7c133250>>}
[1]: {<UIImageView: 0x79f8a5d0; frame = (3 588.5; 588 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x79f89a70>> - (null)}
[2]: {<UIImageView: 0x79fab7d0; frame = (588.5 584; 2.5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x796171f0>> - (null)}
这是在 UICollectionView 中加载项目时的子视图:
[0]: {<MovieCollectionViewCell: 0x796e7350; baseClass = UICollectionViewCell; frame = (0 0; 183 278.16); clipsToBounds = YES; opaque = NO; layer = <CALayer: 0x7c244bc0>>}
[1]: {<MovieCollectionViewCell: 0x7c2b5850; baseClass = UICollectionViewCell; frame = (186 0; 183 278.16); clipsToBounds = YES; opaque = NO; layer = <CALayer: 0x7c2b5950>>}
[2]: {<MovieCollectionViewCell: 0x7c2ba7d0; baseClass = UICollectionViewCell; frame = (0 281; 183 278.16); clipsToBounds = YES; opaque = NO; layer = <CALayer: 0x7c2ba8d0>>}
[3]: {<MovieCollectionViewCell: 0x7c2bf440; baseClass = UICollectionViewCell; frame = (186 281; 183 278.16); clipsToBounds = YES; opaque = NO; layer = <CALayer: 0x7c2bf540>>}
[4]: {<MovieCollectionViewCell: 0x7c2c42d0; baseClass = UICollectionViewCell; frame = (0 562.5; 183 278.16); clipsToBounds = YES; hidden = YES; opaque = NO; layer = <CALayer: 0x7c2c43d0>>}
[5]: {<MovieCollectionViewCell: 0x7c2c9160; baseClass = UICollectionViewCell; frame = (186 562.5; 183 278.16); clipsToBounds = YES; hidden = YES; opaque = NO; layer = <CALayer: 0x7c2c9260>>}
[6]: {<UIRefreshControl: 0x7c132fe0; frame = (0 -69.5; 369 60); autoresize = W; layer = <CALayer: 0x7c133250>>}
[7]: {<UIImageView: 0x7c159e80; frame = (3 522; 363 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7c159fb0>> - (null)}
[8]: {<UIImageView: 0x7c15a480; frame = (363.5 -66.5; 2.5 224); opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7c15a5b0>> - (null)}
谁有想法?
【问题讨论】:
标签: c# ios xamarin uicollectionview