Commit e16d0f5e authored by lujunye's avatar lujunye

修复显示居中bug

parent f75be8af
...@@ -1564,7 +1564,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1564,7 +1564,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell") collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
collectionView.layoutIfNeeded() collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .centeredHorizontally, animated: false) collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
} }
if guiGeArr.count > 2{ if guiGeArr.count > 2{
let leftImg = UIImageView() let leftImg = UIImageView()
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
......
...@@ -1136,7 +1136,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -1136,7 +1136,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell") collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
collectionView.layoutIfNeeded() collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .centeredHorizontally, animated: false) collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
} }
if guiGeArr.count > 2{ if guiGeArr.count > 2{
let leftImg = UIImageView() let leftImg = UIImageView()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment