Skip to content

Section Image not showing.  #359

@minon250

Description

@minon250

Xcode Version: 13
Swift 5
HMSegementedControl Version: 1.5.6

Section Images and titles gets assigned but only the titles shows up and the images do not.
` private func setupPageControls() {

	let image = UIImage(named: "indicator-red")!.withRenderingMode(.alwaysOriginal)
	let images = [image, image, image]

	let segmentedControl = HMSegmentedControl(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 44))
	view.addSubview(segmentedControl)
	segmentedControl.autoSetDimension(.height, toSize: 44)
	segmentedControl.autoPinEdge(toSuperviewEdge: .left)
	segmentedControl.autoPinEdge(toSuperviewEdge: .right)
	segmentedControl.autoPinEdge(toSuperviewEdge: .top)

	segmentedControl.sectionImages = images
	segmentedControl.imagePosition = .leftOfText

	if let fmt = self.configSegmentedControlTitleFormatter() {
		segmentedControl.titleFormatter = fmt
	}
	self.segmentedControl = segmentedControl

	let page = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: nil)
	page.willMove(toParent: self)
	view.addSubview(page.view)
	addChild(page)
	page.didMove(toParent: self)

	page.view.autoPinEdge(.left, to: .left, of: view)
	page.view.autoPinEdge(.right, to: .right, of: view)
	page.view.autoPinEdge(.top, to: .bottom, of: segmentedControl)
	page.view.autoPinEdge(.bottom, to: .bottom, of: view)

	page.delegate = self
	page.dataSource = self
	self.pageController = page

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions