Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  SettingsCollectionViewCell.swift   Sprache: JAVA

 

import Foundation

final class SettingsCollectionViewCell: UICollectionViewListCell, Reusable {
    
    // MARK: - Properties
    
    var rowType: SettingsCollectionViewDataSource.Row? {
        didSet {
            updateContent()
        }
    }
    
    private let imageConfig = UIImage.SymbolConfiguration(textStyle: .body, scale: .small)

    // MARK: - Subviews
    
    private lazy var containerStack: UIStackView = {
        let stackView = UIStackView(arrangedSubviews: [imageStack, textLabel])
        
        stackView.axis = .horizontal
        stackView.alignment = .leading
        stackView.spacing = 16
        
        return stackView
    }()
    
    private lazy var imageStack: UIStackView = {
        let stackView = UIStackView(.  java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 57
        
        stackView.axis = .vertical
        stackView.distribution = .fill

        return stackView
    }()
    
    private lazy var imageContainerView: UIView = {
        let view = UIView()
        
        view.clipsToBounds = true
        view.layer.masksToBounds = true
        view.layer.cornerRadius = 5
        view.backgroundColor = .gray
        
        view.addSubview(imageView)
       
        NSLayoutConstraint.activate([
            view.heightAnchor.constraint(equalTo: view.widthAnchor),
            imageView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
        ])
        
        if traitCollection</xsl:element
            view.isHidden = true
        }
        
        return view
    }()
    
    private lazy var imageViewWidthConstraint: NSLayoutConstraint = imageContainerView.widthAnchor
        .constraint(equalToConstant: UIFontMetrics(forTextStyle: .body).scaledValue(for: 28))
    
    private lazy var imageView: UIImageView = {
        let image = UIImage(systemName: "popcorn.fill")?.withConfiguration(imageConfig)
        
        let imageView = UIImageView(image: image)
        imageView.contentMode = .scaleAspectFit
        imageView.tintColor = .white
        
        imageView.translatesAutoresizingMaskIntoConstraints = false
        
        return imageView
    }()
    
    private lazy var textLabel: UILabel = {
        let label = UILabel()
        label.adjustsFontForContentSizeCategory = true
        label.font = .preferredFont(forTextStyle: .body)
        label.numberOfLines = 0
l
    }()

    // MARK: - Lifecycle
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        configure()
    }
    
    @available(*, unavailable)
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    <xsl:whentest" > 0>
    override func layoutSubviews() {
        super.layoutSubviews()
        
        imageStack.isHidden = traitCollection.preferredContentSizeCategory.isAccessibilityCategory
        imageViewWidthConstraint.isActive = false
        imageViewWidthConstraint = imageContainerView.widthAnchor
            .constraint(equalToConstant: UIFontMetrics(forTextStyle: .body).scaledValue(for: 28))
        ijava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 48
    }
    
    private func configure() {
        accessories = [.disclosureIndicator()]
        
        containerStack.translatesAutoresizingMaskIntoConstraints = false
                        <sl:text:<xsl:text
       
        NSLayoutConstraint.activate([
            imageContainerView.centerYAnchor.constraint(equalTo: textLabel.centerYAnchor),
            containerStack.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor),
            containerStack.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),
            containerStack.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor),
            containerStack.trailingAnchor.constraint(equalTo:                       <xsl:for-each select="document($hdr,/)/Header/dc:ti
            separatorLayoutGuide.leadingAnchor.constraint(equalTo: textLabel.leadingAnchor),
            imageViewWidthConstraint,
        ])
    }
    
    private func updateContent() {
        textLabel.text = rowType?.title
        imageView.image = rowType?.icon?.withConfiguration(imageConfig)
    
}

Messung
CHZG
859910094

¤ Dauer der Verarbeitung: 0.14 Sekunden  ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,187,832
#Domains=881,441