Comments (9)
Sure, i can maybe hide the button when its text is set to nil or "".
from cards.
That would be great, thanks! Want a PR or do you want to do this?
from cards.
Sure, a PR would be great š
from cards.
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.
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.
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.
While Iām adding this feature you could try to comment this line in cardHighlight.swift
backgroundIV.addSubview(actionBtn)
from cards.
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.
Hi @PaoloCuscela,
Thanks! It will help me a lot :)
from cards.
Related Issues (20)
- Image on card HOT 1
- Updating the title when the view is loaded HOT 1
- change font in Card Group Sliding HOT 1
- Adding an image in CardArticle file gives an error HOT 1
- IB Designables: Error [Help :c]
- Is this library supports Swift 4.0 ? HOT 1
- Open detail view into collection view HOT 1
- iOS 13 Card Dismiss doesn't work HOT 1
- Black screen on dismiss action iOS 13 HOT 4
- [Question] Is it possible to change it to new SwiftUI?
- Shadow offset customization
- Dismiss cards cause black screen on iOS13 and Xcode 11.2 HOT 1
- New update turns the view black after closing the view HOT 3
- How to Support Dark Mode
- Crash! HOT 1
- Crash when player card is tapped for fullscreen effect
- Black Screen and Crash! HOT 1
- IOS14 XCODE BETA 4 : Return black screen after dismiss CardView HOT 5
- Card icon color changes to blue when card expands
- How to create multiple cards using code?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cards.