Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not appearing view #34

Closed
M0TRIX opened this issue Jan 22, 2019 · 0 comments
Closed

not appearing view #34

M0TRIX opened this issue Jan 22, 2019 · 0 comments

Comments

@M0TRIX
Copy link

M0TRIX commented Jan 22, 2019

this is my code. and i only see gray line

` let sliderCover = UILabel()
let sliderMainView = UIView()
var slider = RangeSlider()

@objc func priceAction(){
    
    
    let priceLabelSTR = UILabel()
    let priceTo = UILabel()
    let priceFrom = UILabel()
    
    let priceToLabel = UILabel()
    let priceFromLabel = UILabel()
    
    
    let PriceSubmitButton = UIButton()
    let PriceCancleButton = UIButton()
    
    

   
    PriceLabel.backgroundColor = Colors.lowBlue
    PriceLabel.textColor = .white
    
    view.addSubview(sliderMainView)
    sliderMainView.addSubview(slider)
    sliderMainView.addSubview(priceLabelSTR)
    sliderMainView.addSubview(priceFrom)
    sliderMainView.addSubview(priceTo)
    sliderMainView.addSubview(priceToLabel)
    sliderMainView.addSubview(priceFromLabel)
    sliderMainView.addSubview(PriceSubmitButton)
    sliderMainView.addSubview(PriceCancleButton)

    view.addSubview(sliderCover)

    
    
    sliderCover.frame = view.frame
    sliderCover.alpha = 0.5
    sliderCover.backgroundColor = UIColor.black
    
    
    sliderMainView.translatesAutoresizingMaskIntoConstraints=false
    sliderMainView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0).isActive=true
    sliderMainView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0).isActive=true
    sliderMainView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.3).isActive=true
    sliderMainView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0).isActive=true
    sliderMainView.backgroundColor = .white
    view.bringSubviewToFront(sliderMainView)
    sliderCover.bringSubviewToFront(sliderMainView)
    
    
    
    priceLabelSTR.translatesAutoresizingMaskIntoConstraints=false
    priceLabelSTR.trailingAnchor.constraint(equalTo: sliderMainView.trailingAnchor, constant: -16).isActive=true
    priceLabelSTR.topAnchor.constraint(equalTo: sliderMainView.topAnchor, constant: 6).isActive=true
    priceLabelSTR.textColor = Colors.lowBlue
    
    
    slider.translatesAutoresizingMaskIntoConstraints=false
    slider.trailingAnchor.constraint(equalTo: priceLabelSTR.trailingAnchor, constant: 0).isActive=true
    slider.leadingAnchor.constraint(equalTo: sliderMainView.leadingAnchor, constant: 10).isActive=true
    slider.topAnchor.constraint(equalTo: priceLabelSTR.bottomAnchor, constant: -6).isActive=true
    slider.bottomAnchor.constraint(equalTo: sliderMainView.bottomAnchor, constant: 0).isActive=true

    //slider.backgroundColor = Colors.yellow
    slider.addTarget(self, action: #selector(sliderAction(_:)), for: .valueChanged)
    slider.upperValue = 1000
    slider.lowerValue = 1000
    slider.maximumValue = maxPrice
    slider.minimumValue = minPrice
    slider.curvaceousness = 0
    slider.frame = sliderMainView.frame`

}

@M0TRIX M0TRIX closed this as completed Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant