From ff68114fe32bc3e65fdc8ce0b5e958f224446a35 Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Sat, 7 Jun 2025 01:48:57 +0800 Subject: [PATCH] settingsView layout , separatorLine, etc --- Limelight/MenuSectionView.m | 13 ++++++++----- Limelight/ViewControllers/SWRevealViewController.m | 8 ++++---- Limelight/ViewControllers/SettingsViewController.m | 6 ++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Limelight/MenuSectionView.m b/Limelight/MenuSectionView.m index c1fcdc3c..a6374c14 100644 --- a/Limelight/MenuSectionView.m +++ b/Limelight/MenuSectionView.m @@ -45,7 +45,7 @@ - (void)commonInit { // 默认值 _leadingTrailingPadding = 0; - _separatorLinePadding = 9; + _separatorLinePadding = 18; _sectionTitle = @"Section"; _expanded = YES; _backgroundColor = [UIColor clearColor]; @@ -173,11 +173,14 @@ ]]; // 分隔线约束 + self.clipsToBounds = false;//mark: settingMenuLayout [NSLayoutConstraint activateConstraints:@[ - [_separatorLine.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], - [_separatorLine.trailingAnchor constraintEqualToAnchor:self.trailingAnchor], + //[_separatorLine.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], + //[_separatorLine.trailingAnchor constraintEqualToAnchor:self.trailingAnchor], + [_separatorLine.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], + [_separatorLine.widthAnchor constraintEqualToConstant:1000], // //mark: settingMenuLayout [_separatorLine.bottomAnchor constraintEqualToAnchor:self.bottomAnchor], - [_separatorLine.heightAnchor constraintEqualToConstant:1.0] + [_separatorLine.heightAnchor constraintEqualToConstant:2] ]]; [NSLayoutConstraint activateConstraints:@[ @@ -298,7 +301,7 @@ [self setupConstraints]; if (_expanded) { _rootStackView.hidden = NO; - _separatorLine.hidden = YES; + _separatorLine.hidden = NO; CGSize fittingSize = [self.rootStackView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; CGFloat rootStackViewHeight = fittingSize.height; fittingSize = [self.headerView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; diff --git a/Limelight/ViewControllers/SWRevealViewController.m b/Limelight/ViewControllers/SWRevealViewController.m index 9261100b..be51ef8f 100755 --- a/Limelight/ViewControllers/SWRevealViewController.m +++ b/Limelight/ViewControllers/SWRevealViewController.m @@ -687,8 +687,8 @@ const int FrontViewPositionNone = 0xff; _frontViewPosition = FrontViewPositionLeft; _rearViewPosition = FrontViewPositionLeft; _rightViewPosition = FrontViewPositionLeft; - _rearViewRevealWidth = 492.0f; - _rearViewRevealWidth = 400; + // _rearViewRevealWidth = 492.0f; + _rearViewRevealWidth = 350; //mark: settingMenuLayout // _rearViewRevealOverdraw = 60.0f; _rearViewRevealOverdraw = 0.0f; _rearViewRevealDisplacement = 40.0f; @@ -899,8 +899,8 @@ const int FrontViewPositionNone = 0xff; [_separatorLine.bottomAnchor constraintEqualToAnchor:_contentView.bottomAnchor constant:0], //[_separatorLine.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:self.bounds.size.width-60], - [_separatorLine.leadingAnchor constraintEqualToAnchor:_contentView.frontView.leadingAnchor constant:5], - [_separatorLine.trailingAnchor constraintEqualToAnchor:_contentView.frontView.leadingAnchor constant:6.5], + [_separatorLine.leadingAnchor constraintEqualToAnchor:_contentView.frontView.leadingAnchor constant:0], + [_separatorLine.trailingAnchor constraintEqualToAnchor:_contentView.frontView.leadingAnchor constant:2], //mark: settingMenuLayout ]]; } diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index 86ad9c88..6a7e5f6f 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -389,9 +389,8 @@ BOOL isCustomResolution(CGSize res) { [NSLayoutConstraint activateConstraints:@[ [parentStack.topAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.topAnchor constant: [self getStandardNavBarHeight] + 13], [parentStack.bottomAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.bottomAnchor constant:-20], - [parentStack.leadingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.leadingAnchor constant: 14], - [parentStack.trailingAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.trailingAnchor constant: -15], - [parentStack.widthAnchor constraintEqualToAnchor:self.scrollView.contentLayoutGuide.widthAnchor] + [parentStack.centerXAnchor constraintEqualToAnchor:self.view.centerXAnchor constant: 0], //mark: settingMenuLayout + [parentStack.widthAnchor constraintEqualToAnchor:self.view.widthAnchor constant:-20] // section width adjusted here //mark: settingMenuLayout ]]; } @@ -403,7 +402,6 @@ BOOL isCustomResolution(CGSize res) { } - (void)layoutSections{ - NSLog(@"preLoad Log test"); MenuSectionView *videoSection = [[MenuSectionView alloc] init]; videoSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Video"]; if (@available(iOS 13.0, *)) {