fixed constraints
This commit is contained in:
parent
b8127da583
commit
64ada3e61d
@ -70,6 +70,9 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
|||||||
|
|
||||||
bottomConstraint = bottomAnchor.constraint(equalTo: indicatorView.bottomAnchor, constant: PaddingTwo)
|
bottomConstraint = bottomAnchor.constraint(equalTo: indicatorView.bottomAnchor, constant: PaddingTwo)
|
||||||
bottomConstraint?.isActive = true
|
bottomConstraint?.isActive = true
|
||||||
|
|
||||||
|
indicatorView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||||
|
trailingAnchor.constraint(equalTo: indicatorView.trailingAnchor).isActive = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,8 @@ open class BarsIndicatorView: View, IndicatorViewProtocol {
|
|||||||
addSubview(stackView)
|
addSubview(stackView)
|
||||||
isUserInteractionEnabled = false
|
isUserInteractionEnabled = false
|
||||||
|
|
||||||
heightAnchor.constraint(equalToConstant: 4).isActive = true
|
stackView.heightAnchor.constraint(equalToConstant: 4).isActive = true
|
||||||
|
// heightAnchor.constraint(equalToConstant: 4).isActive = true
|
||||||
stackView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
|
stackView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
|
||||||
stackView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
stackView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||||
trailingAnchor.constraint(equalTo: stackView.trailingAnchor).isActive = true
|
trailingAnchor.constraint(equalTo: stackView.trailingAnchor).isActive = true
|
||||||
|
|||||||
@ -87,7 +87,7 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
|
|||||||
super.setupView()
|
super.setupView()
|
||||||
|
|
||||||
isUserInteractionEnabled = false
|
isUserInteractionEnabled = false
|
||||||
|
backgroundColor = .black
|
||||||
addSubview(pageCountLabel)
|
addSubview(pageCountLabel)
|
||||||
addSubview(leftArrow)
|
addSubview(leftArrow)
|
||||||
addSubview(rightArrow)
|
addSubview(rightArrow)
|
||||||
@ -112,11 +112,7 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
|
|||||||
|
|
||||||
open func updateUI(previousIndex oldIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
|
open func updateUI(previousIndex oldIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
|
||||||
|
|
||||||
DispatchQueue.main.async { [weak self] in
|
pageCountLabel.text = "\(newIndex)/\(totalCount)"
|
||||||
guard let self = self else { return }
|
layoutIfNeeded()
|
||||||
|
|
||||||
self.pageCountLabel.text = "\(newIndex)/\(totalCount)"
|
|
||||||
self.layoutIfNeeded()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,6 +97,8 @@ open class Carousel: View {
|
|||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
guard let carouselModel = model as? CarouselModel else { return }
|
guard let carouselModel = model as? CarouselModel else { return }
|
||||||
@ -194,9 +196,9 @@ open class Carousel: View {
|
|||||||
/// Returns the (identifier, class) of the molecule for the given map.
|
/// Returns the (identifier, class) of the molecule for the given map.
|
||||||
func getMoleculeInfo(with molecule: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject?) -> (identifier: String, class: AnyClass, molecule: MoleculeModelProtocol)? {
|
func getMoleculeInfo(with molecule: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject?) -> (identifier: String, class: AnyClass, molecule: MoleculeModelProtocol)? {
|
||||||
guard let className = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(molecule) ,
|
guard let className = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(molecule) ,
|
||||||
let moleculeName = (className as? ModelMoleculeViewProtocol.Type)?.nameForReuse(with: molecule, delegateObject) ?? molecule.moleculeName else {
|
let moleculeName = (className as? ModelMoleculeViewProtocol.Type)?.nameForReuse(with: molecule, delegateObject) ?? molecule.moleculeName
|
||||||
return nil
|
else { return nil }
|
||||||
}
|
|
||||||
return (moleculeName, className, molecule)
|
return (moleculeName, className, molecule)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user