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

Content Insets #35

Open
alexeybolv opened this issue Apr 4, 2018 · 8 comments
Open

Content Insets #35

alexeybolv opened this issue Apr 4, 2018 · 8 comments

Comments

@alexeybolv
Copy link

Cant change content insets top and bottom when set my table view as delegate for re.
but left and right works fine

@ArbabR
Copy link

ArbabR commented Oct 7, 2018

Hi @marty-suzuki any plans for this? Getting the same issue.

@InfiniteDreamz
Copy link

Hi @marty-suzuki Any update on this issue?
@alexeybolv @ArbabR How did you managed it guyz?

@ArbabR
Copy link

ArbabR commented Aug 7, 2019

Hi @InfiniteDreamz not sure about others but try content insets in viewDidLayoutSubviews method. It will work.

override func viewDidLayoutSubviews() {
          super.viewDidLayoutSubviews()
          tableView.contentInset = UIEdgeInsets.init(top: 60, left: 0, bottom: distance, right: 0)
    }

@InfiniteDreamz
Copy link

Hi @InfiniteDreamz not sure about others but try content insets in viewDidLayoutSubviews method. It will work.

override func viewDidLayoutSubviews() {
          super.viewDidLayoutSubviews()
          tableView.contentInset = UIEdgeInsets.init(top: 60, left: 0, bottom: distance, right: 0)
    }

what is 'distance' here? @ArbabR

@ArbabR
Copy link

ArbabR commented Aug 7, 2019

Just put any int value.

@alexeybolv
Copy link
Author

alexeybolv commented Aug 7, 2019

@ArbabR

You can reverse table view like this:

chatTableView.transform = CGAffineTransform(scaleX: 1, y: -1)

And in every cell inside table view:

override func awakeFromNib() { super.awakeFromNib() contentView.transform = CGAffineTransform(scaleX: 1, y: -1)
}

@InfiniteDreamz
Copy link

InfiniteDreamz commented Dec 9, 2019

I was able to set the content inset by giving a bit delay after reloading the tableview. I guess, it's in the framework itself where the content inset is getting reset after the reload & author should look into this on priority. For me, it all started working with:

DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
            self.chatTblView.contentInset = UIEdgeInsets(top: height, left: 0.0, bottom: 0.0, right: 0.0)
        }

@quyentrinh
Copy link

Insert this code to ReverseExtension.swift
public func updateInset(_ inset: UIEdgeInsets) { guard let base = base else { return } base.contentInset.bottom = inset.top base.contentInset.top = inset.bottom self.lastContentInset = base.contentInset }

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

4 participants