change command tool view constraint & transparency

This commit is contained in:
True Zhuanjia committed 2024-07-26 20:15:07 +08:00
1 parent f5342caca6
commit 69056332d3
1 file changed
+6 -5
@@ -16,8 +16,8 @@ import UIKit
private let editButton = UIButton(type: .system) private let editButton = UIButton(type: .system)
private let exitButton = UIButton(type: .system) private let exitButton = UIButton(type: .system)
private let pinButton = UIButton(type: .system) private let pinButton = UIButton(type: .system)
private let viewBackgroundColor = UIColor(white: 0.2, alpha: 1.0); private let viewBackgroundColor = UIColor(white: 0.2, alpha: 0.8);
private let highlightColor = UIColor(white: 0.3, alpha: 1.0); private let highlightColor = UIColor(white: 0.39, alpha: 0.8);
private let titleLabel = UILabel() private let titleLabel = UILabel()
private var viewPinned: Bool = false private var viewPinned: Bool = false
@@ -113,8 +113,8 @@ import UIKit
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
// Set the width and height of the view // Set the width and height of the view
view.widthAnchor.constraint(equalTo: view.superview!.widthAnchor, multiplier: 0.7), view.widthAnchor.constraint(equalTo: view.superview!.widthAnchor, multiplier: 1),
view.heightAnchor.constraint(equalTo: view.superview!.heightAnchor, multiplier: 0.9), view.heightAnchor.constraint(equalTo: view.superview!.heightAnchor, multiplier: 1),
// Center the view horizontally and vertically // Center the view horizontally and vertically
view.centerXAnchor.constraint(equalTo: view.superview!.centerXAnchor), view.centerXAnchor.constraint(equalTo: view.superview!.centerXAnchor),
@@ -242,9 +242,10 @@ import UIKit
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
// Configure cell appearance // Configure cell appearance
cell.backgroundColor = viewBackgroundColor // Set background color of the cell cell.backgroundColor = .clear // Set background color of the cell
cell.textLabel?.textColor = UIColor.white // Set font color of the text cell.textLabel?.textColor = UIColor.white // Set font color of the text
// Set selected background view // Set selected background view
let selectedBackgroundView = UIView() let selectedBackgroundView = UIView()
selectedBackgroundView.backgroundColor = highlightColor // Color for the selected state selectedBackgroundView.backgroundColor = highlightColor // Color for the selected state