Commit 8edb7d4b authored by yqz's avatar yqz

ui 调整

parent 56ff6516
......@@ -93,10 +93,10 @@
<rect key="frame" x="393" y="0.0" width="393" height="613.33333333333337"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalCentering" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="2Yh-GL-Q2t">
<rect key="frame" x="38" y="5" width="317" height="433.33333333333331"/>
<rect key="frame" x="37.666666666666686" y="30" width="317.66666666666669" height="408.33333333333331"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Similar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IhS-Gp-baN">
<rect key="frame" x="0.0" y="0.0" width="317" height="16"/>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Similar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IhS-Gp-baN">
<rect key="frame" x="0.0" y="-16" width="317.66666666666669" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="eb1-DU-oKO"/>
</constraints>
......@@ -105,13 +105,13 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_similar_1" translatesAutoresizingMaskIntoConstraints="NO" id="kvj-jW-PoF">
<rect key="frame" x="0.0" y="31" width="317" height="178"/>
<rect key="frame" x="0.0" y="0.0" width="317.66666666666669" height="178.33333333333334"/>
<constraints>
<constraint firstAttribute="width" secondItem="kvj-jW-PoF" secondAttribute="height" multiplier="317:178" id="IaD-TY-qFl"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Similar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GIs-vI-kWE">
<rect key="frame" x="0.0" y="224" width="317" height="16.333333333333343"/>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Similar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GIs-vI-kWE">
<rect key="frame" x="0.0" y="186" width="317.66666666666669" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16.329999999999998" id="9nH-oa-mxO"/>
</constraints>
......@@ -120,7 +120,7 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_similar_2" translatesAutoresizingMaskIntoConstraints="NO" id="x0D-ou-xRd">
<rect key="frame" x="0.0" y="255.33333333333331" width="317" height="178"/>
<rect key="frame" x="0.0" y="230" width="317.66666666666669" height="178.33333333333337"/>
<constraints>
<constraint firstAttribute="width" secondItem="x0D-ou-xRd" secondAttribute="height" multiplier="317:178" id="J9F-Fe-BXn"/>
</constraints>
......@@ -157,7 +157,7 @@
<constraint firstAttribute="bottom" secondItem="jsL-Yg-DRw" secondAttribute="bottom" constant="5" id="43v-pu-Het"/>
<constraint firstAttribute="trailing" secondItem="jsL-Yg-DRw" secondAttribute="trailing" constant="40" id="5Ef-zt-VFy"/>
<constraint firstItem="jsL-Yg-DRw" firstAttribute="top" secondItem="2Yh-GL-Q2t" secondAttribute="bottom" constant="55" id="J8w-6L-NOv"/>
<constraint firstItem="2Yh-GL-Q2t" firstAttribute="top" secondItem="hlo-KY-MjE" secondAttribute="top" constant="5" id="YLv-9p-1VS"/>
<constraint firstItem="2Yh-GL-Q2t" firstAttribute="top" secondItem="hlo-KY-MjE" secondAttribute="top" constant="30" id="YLv-9p-1VS"/>
<constraint firstItem="jsL-Yg-DRw" firstAttribute="leading" secondItem="hlo-KY-MjE" secondAttribute="leading" constant="40" id="r4Y-Et-KLn"/>
<constraint firstItem="2Yh-GL-Q2t" firstAttribute="centerX" secondItem="hlo-KY-MjE" secondAttribute="centerX" id="wde-o8-kYH"/>
</constraints>
......
......@@ -111,7 +111,7 @@ extension HomeCollectionViewHeader{
if let range1 = text.range(of: countString) {
let nsRange1 = NSRange(range1, in: text)
attributedText.addAttributes([
.foregroundColor: UIColor.colorWithHex(hexStr: black6Color),
.foregroundColor: UIColor.colorWithHex(hexStr: mColor),
.font:UIFont.systemFont(ofSize: 12, weight: .semibold)
], range: nsRange1)
}
......@@ -121,7 +121,7 @@ extension HomeCollectionViewHeader{
let nsRange2 = NSRange(range2, in: text)
attributedText.addAttributes([
.font:UIFont.systemFont(ofSize: 12, weight: .semibold),
.foregroundColor: UIColor.colorWithHex(hexStr: black6Color)
.foregroundColor: UIColor.colorWithHex(hexStr: mColor)
], range: nsRange2)
}
return attributedText
......
......@@ -302,20 +302,16 @@ extension HomeView:WaterfallMutiSectionDelegate,UICollectionViewDataSource,UICol
if indexPath.section == 0 {
let model = viewModel.headerGroup[indexPath.row] //model?.titleModelArray[indexPath.row]
if model.assets.count > 0 {
return (model.assets.first?.count ?? 0) > 2 ? ((collection.width - marginLR - 20) / 2.5) + 64 : ((collection.width - 2 * marginLR - 10) / 2) + 64
return (model.assets.first?.count ?? 0) > 2 ? ((collection.width - marginLR - 20) / 2.2) + 64 : ((collection.width - 2 * marginLR - 10) / 2) + 64
}else{
return 52
return 38
}
}else {
let model = viewModel.cardGroup[indexPath.row] //model?.otherModelArray[indexPath.row]
return itemWidth + 12 + UILabel.getSizeWith(font: UIFont.systemFont(ofSize: 16, weight: .bold),lineSpacing: 5, width: itemWidth - 32, numberOfLines: 0, content: model.folderName).height
}
}
......@@ -343,7 +339,7 @@ extension HomeView:WaterfallMutiSectionDelegate,UICollectionViewDataSource,UICol
switch section {
case 1:
return 11
return 5
default:
return 0
......@@ -446,7 +442,7 @@ extension HomeView{
// 设置整体文本样式
let fullTextAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 12, weight: .regular),
.font: UIFont.systemFont(ofSize: 14, weight: .regular),
.foregroundColor: UIColor(red: 0.4, green: 0.4, blue: 0.4,alpha:1)
]
attributedText.addAttributes(fullTextAttributes, range: NSRange(location: 0, length: text.count))
......@@ -455,8 +451,8 @@ extension HomeView{
if let range1 = text.range(of: countString) {
let nsRange1 = NSRange(range1, in: text)
attributedText.addAttributes([
.foregroundColor: UIColor.colorWithHex(hexStr: black6Color),
.font:UIFont.systemFont(ofSize: 12, weight: .semibold)
.foregroundColor: UIColor.colorWithHex(hexStr: mColor),
.font:UIFont.systemFont(ofSize: 12, weight: .regular)
], range: nsRange1)
}
......@@ -464,8 +460,8 @@ extension HomeView{
if let range2 = text.range(of: fileSizeString) {
let nsRange2 = NSRange(range2, in: text)
attributedText.addAttributes([
.font:UIFont.systemFont(ofSize: 12, weight: .semibold),
.foregroundColor: UIColor.colorWithHex(hexStr: black6Color)
.font:UIFont.systemFont(ofSize: 14, weight: .regular),
.foregroundColor: UIColor.colorWithHex(hexStr: mColor)
], range: nsRange2)
}
return attributedText
......
......@@ -17,7 +17,7 @@ class HomeOtherCollectionCell: UICollectionViewCell {
let iv = UIImageView()
iv.contentMode = .scaleAspectFill
iv.clipsToBounds = true
iv.layer.cornerRadius = 8
iv.layer.cornerRadius = 12
iv.backgroundColor = .clear
return iv
}()
......@@ -25,8 +25,8 @@ class HomeOtherCollectionCell: UICollectionViewCell {
private let infoBackView: UIView = {
let iv = UIView()
iv.clipsToBounds = true
iv.layer.cornerRadius = 8
iv.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.4)
iv.layer.cornerRadius = 12
iv.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.3)
return iv
}()
......@@ -34,7 +34,7 @@ class HomeOtherCollectionCell: UICollectionViewCell {
public var countLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.font = .systemFont(ofSize: 14, weight: .medium)
label.font = .systemFont(ofSize: 14, weight: .bold)
label.textAlignment = .left
return label
}()
......@@ -42,7 +42,7 @@ class HomeOtherCollectionCell: UICollectionViewCell {
let sizeLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.font = .systemFont(ofSize: 10, weight: .medium)
label.font = .systemFont(ofSize: 10, weight: .regular)
label.textAlignment = .left
return label
}()
......@@ -57,7 +57,7 @@ class HomeOtherCollectionCell: UICollectionViewCell {
private let titleLabel: UILabel = {
let label = UILabel()
label.font = .systemFont(ofSize: 16, weight: .bold)
label.font = .systemFont(ofSize: 18, weight: .semibold)
label.textColor = UIColor.colorWithHex(hexStr: black3Color)
label.textAlignment = .left
label.numberOfLines = 0
......@@ -342,9 +342,9 @@ class HomeOtherCollectionCell: UICollectionViewCell {
imageView.snp.makeConstraints { make in
make.top.equalTo(self.titleLabel.snp.bottom).offset(8)
make.left.equalToSuperview().offset(16)
make.width.equalToSuperview().offset(-32)
make.height.equalTo(self.width - 32)
make.left.equalToSuperview().offset(8)
make.width.equalToSuperview().offset(-16)
make.height.equalTo(self.width - 16)
}
self.infoBackView.snp.makeConstraints { make in
......@@ -361,8 +361,8 @@ class HomeOtherCollectionCell: UICollectionViewCell {
titleLabel.snp.makeConstraints { make in
make.left.top.equalToSuperview().offset(16)
make.width.equalToSuperview().offset(-32)
make.left.top.equalToSuperview().offset(8)
make.width.equalToSuperview().offset(-16)
}
self.countLabel.snp.makeConstraints { make in
......@@ -377,7 +377,7 @@ class HomeOtherCollectionCell: UICollectionViewCell {
}
self.moreImageView.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.right.equalToSuperview().offset(-12)
make.left.equalTo(countLabel.snp.right).offset(7)
make.centerY.equalToSuperview()
}
}
......
......@@ -46,7 +46,6 @@ class HomeTitleCollectionCell:UICollectionViewCell {
self.layer.cornerRadius = 12
self.layer.masksToBounds = true
titleLabel = UILabel()
titleLabel.font = UIFont.systemFont(ofSize: 18, weight: .bold)
titleLabel.textColor = UIColor.colorWithHex(hexStr: black3Color)
......@@ -57,7 +56,7 @@ class HomeTitleCollectionCell:UICollectionViewCell {
let flowlayout:UICollectionViewFlowLayout = UICollectionViewFlowLayout()
flowlayout.scrollDirection = .horizontal
flowlayout.minimumLineSpacing = 10
flowlayout.minimumLineSpacing = 4
collectionView = UICollectionView.init(frame: CGRectMake(0, 0 , ScreenW , ScreenH), collectionViewLayout: flowlayout)
collectionView?.backgroundColor = .clear
......@@ -67,7 +66,7 @@ class HomeTitleCollectionCell:UICollectionViewCell {
collectionView?.showsVerticalScrollIndicator = false
collectionView?.register(ImageCollectionCell.self, forCellWithReuseIdentifier: ImageCollectionCell.identifiers)
collectionView?.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: marginLR)
collectionView?.contentInset = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: marginLR)
collectionView?.dataSource = self
collectionView?.delegate = self
......@@ -157,7 +156,7 @@ class HomeTitleCollectionCell:UICollectionViewCell {
titleLabel.snp.makeConstraints({ make in
make.top.left.equalTo(16)
make.top.left.equalTo(8)
})
titleLabel.sizeToFit()
......@@ -171,16 +170,16 @@ class HomeTitleCollectionCell:UICollectionViewCell {
fileLabel?.sizeToFit()
collectionView?.snp.makeConstraints({ make in
make.left.equalTo(16)
make.left.equalTo(8)
make.bottom.equalTo(0)
make.right.equalTo(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(13)
make.right.equalTo(-8)
make.top.equalTo(titleLabel.snp.bottom).offset(0)
})
nextImage?.snp.makeConstraints({ make in
make.centerY.equalTo(fileLabel!)
make.right.equalTo(-12)
make.right.equalToSuperview().inset(12)
make.width.height.equalTo(20)
})
}
......@@ -205,13 +204,13 @@ extension HomeTitleCollectionCell:UICollectionViewDelegate,UICollectionViewDataS
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
// 计算 cell 宽度
let width = max(0, collectionView.height - 18) // 使用实际的宽度计算方法
let height = max(0,collectionView.height - 18) // 使用实际的高度计算方法
let width = max(0, collectionView.height - 16) // 使用实际的宽度计算方法
let height = max(0, collectionView.height - 16) // 使用实际的高度计算方法
return CGSize(width:width, height: height) // 宽高相等,形成网格
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 10 // 设置列间距
return 4 // 设置列间距
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
homeTititlAction(1)
......
......@@ -84,7 +84,7 @@ class HomeVideoCoverCell: UICollectionViewCell {
let iv = UIImageView()
iv.contentMode = .scaleAspectFill
iv.clipsToBounds = true
iv.layer.cornerRadius = 8
iv.layer.cornerRadius = 12
iv.backgroundColor = .clear
return iv
}()
......@@ -92,8 +92,8 @@ class HomeVideoCoverCell: UICollectionViewCell {
private let infoBackView: UIView = {
let iv = UIView()
iv.clipsToBounds = true
iv.layer.cornerRadius = 8
iv.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.4)
iv.layer.cornerRadius = 12
iv.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.3)
return iv
}()
......@@ -101,7 +101,7 @@ class HomeVideoCoverCell: UICollectionViewCell {
public var countLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.font = .systemFont(ofSize: 14, weight: .medium)
label.font = .systemFont(ofSize: 14, weight: .bold)
label.textAlignment = .left
return label
}()
......@@ -109,7 +109,7 @@ class HomeVideoCoverCell: UICollectionViewCell {
let sizeLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.font = .systemFont(ofSize: 10, weight: .medium)
label.font = .systemFont(ofSize: 10, weight: .regular)
label.textAlignment = .left
return label
}()
......@@ -124,7 +124,7 @@ class HomeVideoCoverCell: UICollectionViewCell {
private let titleLabel: UILabel = {
let label = UILabel()
label.font = .systemFont(ofSize: 16, weight: .bold)
label.font = .systemFont(ofSize: 18, weight: .semibold)
label.textColor = UIColor.colorWithHex(hexStr: black3Color)
label.textAlignment = .left
label.numberOfLines = 0
......@@ -138,9 +138,9 @@ class HomeVideoCoverCell: UICollectionViewCell {
imageView.snp.makeConstraints { make in
make.top.equalTo(self.titleLabel.snp.bottom).offset(8)
make.left.equalToSuperview().offset(16)
make.width.equalToSuperview().offset(-32)
make.height.equalTo(self.width - 32)
make.left.equalToSuperview().offset(8)
make.width.equalToSuperview().offset(-16)
make.height.equalTo(self.width - 16)
}
self.infoBackView.snp.makeConstraints { make in
......@@ -151,8 +151,8 @@ class HomeVideoCoverCell: UICollectionViewCell {
titleLabel.snp.makeConstraints { make in
make.left.top.equalToSuperview().offset(16)
make.width.equalToSuperview().offset(-32)
make.left.top.equalToSuperview().offset(8)
make.width.equalToSuperview().offset(-16)
}
self.countLabel.snp.makeConstraints { make in
......@@ -167,7 +167,7 @@ class HomeVideoCoverCell: UICollectionViewCell {
}
self.moreImageView.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.right.equalToSuperview().offset(-12)
make.left.equalTo(countLabel.snp.right).offset(7)
make.centerY.equalToSuperview()
}
......
......@@ -437,13 +437,13 @@ class HomePayView:UIView {
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(subTitle.snp.bottom).offset(8.RH())
make.bottom.equalToSuperview().offset(-16)
// make.bottom.equalToSuperview().offset(-16)
}
tipsView.snp.makeConstraints { make in
make.top.equalTo(titleLabel2!.snp.bottom).offset(230.RH())
make.left.right.equalToSuperview().inset(marginLR)
// make.height.equalTo(110.RH())
make.height.equalTo(130.RH())
}
payDueView.snp.makeConstraints { make in
......
......@@ -34,7 +34,7 @@ class SettingNormalCell : UITableViewCell {
lazy var fLabel : UILabel = {
let label = UILabel();
label.text = "ceshi"
label.font = UIFont.systemFont(ofSize: 14, weight: .bold)
label.font = UIFont.systemFont(ofSize: 16, weight: .semibold)
label.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
label.textAlignment = .left
return label
......@@ -64,7 +64,7 @@ class SettingNormalCell : UITableViewCell {
}
self.fLabel.snp.makeConstraints { make in
make.left.equalTo(self.logoView.snp.right).offset(4)
make.left.equalTo(self.logoView.snp.right).offset(12)
make.top.equalToSuperview()
make.height.equalTo(60)
make.bottom.equalToSuperview()
......
......@@ -55,7 +55,7 @@ class SettingSwitchCell : UITableViewCell {
lazy var fLabel : UILabel = {
let label = UILabel();
label.text = "ceshi"
label.font = UIFont.systemFont(ofSize: 14, weight: .bold)
label.font = UIFont.systemFont(ofSize: 16, weight: .semibold)
label.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
label.textAlignment = .left
return label
......@@ -86,7 +86,7 @@ class SettingSwitchCell : UITableViewCell {
}
self.fLabel.snp.makeConstraints { make in
make.left.equalTo(self.logoView.snp.right).offset(4)
make.left.equalTo(self.logoView.snp.right).offset(12)
make.top.equalToSuperview()
make.height.equalTo(60)
make.width.equalTo(206)
......
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