maxep / MXParallaxHeader

Simple parallax header for UIScrollView
MIT License
1.73k stars 251 forks source link

Weird width on MXParallaxHeader 1.1.0 #114

Closed vkcldhkd closed 4 years ago

vkcldhkd commented 4 years ago

Issue Description

Environment Information

Your Code

let height: CGFloat = Constants.APPDELEGATE.cellSize.height + 50 + UIWindow.safeAreaTopInset

    override func viewDidLoad() {
        super.viewDidLoad()

        detailTableView.contentInsetAdjustmentBehavior = .never
        headerView = PostDetailCardView()
        detailTableView.parallaxHeader.view = headerView
        detailTableView.parallaxHeader.height = height
        detailTableView.parallaxHeader.mode = .fill
        detailTableView.parallaxHeader.minimumHeight = 0
}

Screenshot

IMG_0058 by MXParallaxHeader 0.6.1

IMG_0059 by MXParallaxHeader 1.1.0

macoapps commented 4 years ago

Same issue here :(

alflix commented 4 years ago

as for me, add width constraint of your headerView cant fix this issue

iOSDevFin commented 4 years ago

I have the same issue

Nahatakyan commented 4 years ago

I have the same issue. I fixed it like this.

tableViewHeaderView = TableHeader(frame: view.bounds)
tableViewHeaderView.translatesAutoresizingMaskIntoConstraints = false

tableView.parallaxHeader.view = tableViewHeaderView
tableView.parallaxHeader.height = view.frame.height * 0.6
tableView.parallaxHeader.mode = .fill
tableView.parallaxHeader.minimumHeight = 0

tableViewHeaderView.widthAnchor.constraint(equalTo: tableView.widthAnchor).isActive = true
macoapps commented 4 years ago

Nice fix, it works perfectly for me !

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Harshvk commented 4 years ago

Getting the same issue. The above-mentioned solution is also not working when header is instantiated from the nib.

RaheelCr7 commented 4 years ago

Scroll not working after I am adding width constraint! please help

SandsHellCreations commented 4 years ago

Above solutions didn't work same error

Screenshot 2020-05-15 at 3 30 06 PM
SandsHellCreations commented 4 years ago

Issue is in your latest version of pod 0.6.1 this release version of your code working fine

MohdElBasyouni commented 4 years ago

Same problem here and thanks to @Nahatakyan , below code fix it;

tableViewHeaderView.translatesAutoresizingMaskIntoConstraints = false tableViewHeaderView.widthAnchor.constraint(equalTo: tableView.widthAnchor).isActive

moquiutijunio commented 4 years ago

I solved this problem fixing width in my header view!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.