Commit 09f07cfe authored by lujunye's avatar lujunye

修复地址分行显示

parent 1600d410
...@@ -109,8 +109,8 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -109,8 +109,8 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
if cus_id != nil { if cus_id != nil {
HUD.flash(.progress) HUD.flash(.progress)
searchBgH.constant = 0 searchBgH.constant = 0
getAddrsInfo(["user_token":UserToken,"cus_id":cus_id], success: { (data) in getAddrsInfo(["user_token":UserToken as Any,"cus_id":cus_id as Any], success: { (data) in
self.adrInfo = data as! GetAddrsInfoModel self.adrInfo = (data as! GetAddrsInfoModel)
self.listView.reloadData() self.listView.reloadData()
HUD.hide() HUD.hide()
}) { (error) in }) { (error) in
...@@ -152,7 +152,8 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -152,7 +152,8 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
btmLblHeight.constant = 0 btmLblHeight.constant = 0
} }
listView.estimatedRowHeight = 49
listView.rowHeight = UITableView.automaticDimension
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
...@@ -187,9 +188,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -187,9 +188,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
} }
return adrArrs.count return adrArrs.count
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 79
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell
cell.delegate = self cell.delegate = self
...@@ -295,6 +294,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -295,6 +294,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
options.expansionStyle = .selection //展开样式(默认为.none) options.expansionStyle = .selection //展开样式(默认为.none)
return options return options
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return tableView.rowHeight
}
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? { func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? {
let tag = indexPath.row let tag = indexPath.row
......
...@@ -73,8 +73,8 @@ ...@@ -73,8 +73,8 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="广东省广州市番禺区市桥南路电脑城" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SOh-hJ-gKS"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="广东省广州市番禺区市桥南路电脑城" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SOh-hJ-gKS">
<rect key="frame" x="50" y="52" width="212.5" height="16"/> <rect key="frame" x="50" y="48.5" width="290" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="灰色字体颜色"/> <color key="textColor" name="灰色字体颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -112,18 +112,20 @@ ...@@ -112,18 +112,20 @@
<constraint firstItem="vAQ-5q-KPr" firstAttribute="leading" secondItem="oeS-KW-qjD" secondAttribute="trailing" constant="15" id="4ok-AC-XWT"/> <constraint firstItem="vAQ-5q-KPr" firstAttribute="leading" secondItem="oeS-KW-qjD" secondAttribute="trailing" constant="15" id="4ok-AC-XWT"/>
<constraint firstAttribute="trailing" secondItem="raS-k5-oNa" secondAttribute="trailing" id="5WN-Ud-Jc7"/> <constraint firstAttribute="trailing" secondItem="raS-k5-oNa" secondAttribute="trailing" id="5WN-Ud-Jc7"/>
<constraint firstItem="oeS-KW-qjD" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="79g-ox-Ohm"/> <constraint firstItem="oeS-KW-qjD" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="79g-ox-Ohm"/>
<constraint firstItem="raS-k5-oNa" firstAttribute="top" secondItem="SOh-hJ-gKS" secondAttribute="bottom" constant="9" id="7WS-7Y-X8x"/>
<constraint firstItem="0Zd-v3-Vtu" firstAttribute="centerY" secondItem="vAQ-5q-KPr" secondAttribute="centerY" id="94d-JF-XNY"/> <constraint firstItem="0Zd-v3-Vtu" firstAttribute="centerY" secondItem="vAQ-5q-KPr" secondAttribute="centerY" id="94d-JF-XNY"/>
<constraint firstItem="raS-k5-oNa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Bl7-ud-MH8"/> <constraint firstItem="raS-k5-oNa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Bl7-ud-MH8"/>
<constraint firstItem="vAQ-5q-KPr" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="GB4-TQ-IJc"/> <constraint firstItem="vAQ-5q-KPr" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="GB4-TQ-IJc"/>
<constraint firstItem="7eJ-B4-h9O" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="H4Y-Hp-W29"/> <constraint firstItem="7eJ-B4-h9O" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="H4Y-Hp-W29"/>
<constraint firstItem="SOh-hJ-gKS" firstAttribute="top" secondItem="jf6-0X-5eB" secondAttribute="bottom" constant="15" id="Lxh-Z0-Emg"/>
<constraint firstItem="jf6-0X-5eB" firstAttribute="centerY" secondItem="0Zd-v3-Vtu" secondAttribute="centerY" id="Mbj-p2-VdQ"/> <constraint firstItem="jf6-0X-5eB" firstAttribute="centerY" secondItem="0Zd-v3-Vtu" secondAttribute="centerY" id="Mbj-p2-VdQ"/>
<constraint firstItem="raS-k5-oNa" firstAttribute="top" secondItem="SOh-hJ-gKS" secondAttribute="bottom" constant="10" id="Q1e-gA-4qh"/>
<constraint firstItem="mWp-V0-KaZ" firstAttribute="leading" secondItem="jf6-0X-5eB" secondAttribute="trailing" constant="10" id="Q58-SO-drh"/> <constraint firstItem="mWp-V0-KaZ" firstAttribute="leading" secondItem="jf6-0X-5eB" secondAttribute="trailing" constant="10" id="Q58-SO-drh"/>
<constraint firstItem="oeS-KW-qjD" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="cia-6b-Gc1"/> <constraint firstItem="oeS-KW-qjD" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="cia-6b-Gc1"/>
<constraint firstItem="SOh-hJ-gKS" firstAttribute="leading" secondItem="vAQ-5q-KPr" secondAttribute="leading" id="is0-NC-Im1"/> <constraint firstItem="7eJ-B4-h9O" firstAttribute="leading" secondItem="SOh-hJ-gKS" secondAttribute="trailing" constant="15" id="iaQ-5H-nCe"/>
<constraint firstAttribute="bottom" secondItem="raS-k5-oNa" secondAttribute="bottom" id="ow3-Vt-3kW"/> <constraint firstAttribute="bottom" secondItem="raS-k5-oNa" secondAttribute="bottom" id="ow3-Vt-3kW"/>
<constraint firstAttribute="trailing" secondItem="7eJ-B4-h9O" secondAttribute="trailing" constant="15" id="rrB-jM-gXG"/> <constraint firstAttribute="trailing" secondItem="7eJ-B4-h9O" secondAttribute="trailing" constant="15" id="rrB-jM-gXG"/>
<constraint firstItem="mWp-V0-KaZ" firstAttribute="centerY" secondItem="jf6-0X-5eB" secondAttribute="centerY" id="sXS-NF-LT4"/> <constraint firstItem="mWp-V0-KaZ" firstAttribute="centerY" secondItem="jf6-0X-5eB" secondAttribute="centerY" id="sXS-NF-LT4"/>
<constraint firstItem="SOh-hJ-gKS" firstAttribute="leading" secondItem="vAQ-5q-KPr" secondAttribute="leading" id="vqA-bs-BfP"/>
<constraint firstItem="jf6-0X-5eB" firstAttribute="leading" secondItem="0Zd-v3-Vtu" secondAttribute="trailing" constant="10" id="wng-fe-Xxb"/> <constraint firstItem="jf6-0X-5eB" firstAttribute="leading" secondItem="0Zd-v3-Vtu" secondAttribute="trailing" constant="10" id="wng-fe-Xxb"/>
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
......
...@@ -104,13 +104,10 @@ class MsgCenterViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -104,13 +104,10 @@ class MsgCenterViewController: BaseViewController,UITableViewDelegate,UITableVie
//MARK: -Cell delegate方法 //MARK: -Cell delegate方法
// func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
// return 120 return tableView.rowHeight
// }
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
print(tableView.estimatedRowHeight)
return 250
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.dataModelArr.count return self.dataModelArr.count
} }
......
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