GithubHelp home page GithubHelp logo

Wrong width about bryxbanner HOT 7 CLOSED

bryx-inc avatar bryx-inc commented on August 16, 2024
Wrong width

from bryxbanner.

Comments (7)

MaxFrax avatar MaxFrax commented on August 16, 2024

I found a little hack to avoid the problem, but it's not a real fix. I added a backgroundView (an UIView with the same frame of the tableView) on the tableView and then I showed the banner on the backgroundView.

from bryxbanner.

harlanhaskins avatar harlanhaskins commented on August 16, 2024

That's very weird -- the Banner is created with leading and trailing constraints that don't use constants. Care to share the code you used?

from bryxbanner.

MaxFrax avatar MaxFrax commented on August 16, 2024
import Foundation
extension UIView {
    func showError(title: String, subtitle: String, image: UIImage?){
        let banner = Banner(title: title, subtitle: subtitle, image: image, backgroundColor: UIColor.redColor(), didTapBlock: nil)
        banner.animationDuration = 1
        banner.show(self, duration: 2)
    }
}

And in a UITableViewController

self.tableView.showError("Impossibile caricare i dati dalla rubrica", subtitle: "", image: nil)

from bryxbanner.

xdoug7 avatar xdoug7 commented on August 16, 2024

+1
I'm with the same problem here. The banner is always fitting the text width.
Other hack that I found to avoid this:

Banner(title: title, subtitle: subtitle).show(view: self.tableView.tableHeaderView)

from bryxbanner.

nahouto avatar nahouto commented on August 16, 2024

same error here in a UIViewController. The banner is set as label's intrisinc size

from bryxbanner.

harlanhaskins avatar harlanhaskins commented on August 16, 2024

Is this still an issue? 😕

from bryxbanner.

johndpope avatar johndpope commented on August 16, 2024

this is related to uitableview hardcoding width of cells to 320 http://stackoverflow.com/questions/26373102/uitableview-cell-width-on-ios-8-stuck-at-320pt

in cellforrowat index try forcing the frame size

cell.frame = CGRectMake(0,
0,
self.tableView.frame.size.width,
cell.frame.size.height);

http://stackoverflow.com/questions/13025616/uitableviewcell-width-is-greater-than-uitableview-width

from bryxbanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.