Git Product home page Git Product logo

Comments (9)

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

Sure, i can maybe hide the button when its text is set to nil or "".

from cards.

J7mbo avatar J7mbo commented on August 25, 2024

That would be great, thanks! Want a PR or do you want to do this?

from cards.

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

Sure, a PR would be great šŸ‘

from cards.

mymikemiller avatar mymikemiller commented on August 25, 2024

Another option is to use a CardArticle instead of a CardHighlight if you don't mind also removing the icon, not taking up the full screen when showing the detail view, and not having an "x" in the upper-right to close the detail view.

I propose changing CardArticle to behave more like the article cards do in the App Store: take up the full screen when opened (no margins on left and right), and have an "x" button in the top right that stays there as long as the details are showing (the CardHighlight details page doesn't show the "x" until the card is scrolled down a bit; in the App Store, the "x" is always there)

from cards.

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

Setting the text button to nil or "" in the next release will make the button to disappear

If you want the XButton to stay on just delete

xButton.alpha = y - (card.backgroundIV.bounds.height * 0.6)

in DetailViewController -> scrollViewDidScroll( :)
And set

xButton.alpha = 0 // To 1

in viewDidDLoad()

from cards.

danilobias avatar danilobias commented on August 25, 2024

Hi,
I'd like to use CardHighlight without the "view" button, but I do not think that's possible even on the last release.

Is there any way to hide this button?

from cards.

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

While Iā€™m adding this feature you could try to comment this line in cardHighlight.swift

backgroundIV.addSubview(actionBtn)

from cards.

PaoloCuscela avatar PaoloCuscela commented on August 25, 2024

I' ve pushed the feature you asked for :D.
It will be in the next release. If you want to test it out:
Change in CardHighlight.swift

/**
     Text for the card's button.
     Set to [nil] or "" to hide the button.
     */
    @IBInspectable public var buttonText: String? = "view" {
        didSet{
            self.actionBtn.isHidden = (buttonText == nil || buttonText!.isEmpty)
            self.setNeedsDisplay()
        }
    }

and in draw(rect:) before 'layout()'

if self.buttonText != nil {
  let btnTitle = NSAttributedString(string: buttonText!.uppercased(), attributes: [ NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16, weight: .black), NSAttributedString.Key.foregroundColor : self.tintColor])
  actionBtn.setAttributedTitle(btnTitle, for: .normal)
  btnWidth = CGFloat((buttonText!.count + 2) * 10)
}

from cards.

danilobias avatar danilobias commented on August 25, 2024

Hi @PaoloCuscela,

Thanks! It will help me a lot :)

from cards.

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.