Closed sohayb closed 8 years ago
I am not able to reproduce the issue.
If you do not want it to be public, please send to support@cosmicmind.io :)
Preparing the sample now :)
Hey @sohayb :)
I reviewed your example code and I believe it is best I answer here so that others may learn from the issue you had pointed out. Within the CardView there is a method called reloadView that is called when a property is altered from its original value, in this case CardView.divider = false. Internal to the reloadView method, AutoLayout is used to create the CardView layout. It looks that the CardView is not actually holding any of its known property values, and a UILabel is added to the CardView to create the effect you are looking for. Since the CardView doesn't have a titleLabel, detailLabel, buttons, or divider, it concludes using AutoLayout that there is not anything to layout and a height of 0 is applied.
My suggestion would be to use a MaterialView in this case, which would give you the backgroundColor, shadow, and shape that it looks like you are trying to achieve. If you want a pulse animation, you can use the MaterialPulseView, and if you are looking for a button.target, the RaisedButton looks to be the one you would want in this instance.
Thoughts?
You're right, I'm not using the CardView where it's supposed to be used, so the error is by design (my case is an odd one, sry for that :) ) Wanted to place a button with an image on it, so I should be better off with the MaterialPulseView. Closing this for now
No worries. If you want a button, why not use one of the MaterialButtons? They are fully customizable like the views. They also support an image layer with button.setImage(…)
Daniel Dahan
M: +1 647.627.0770 Skype: djondahan
On Dec 13, 2015, at 2:41 PM, Sohayb Hassoun notifications@github.com wrote:
You're right, I'm not using the CardView where it's supposed to be used, so the error is by design (my case is an odd one, sry for that :) ) Wanted to place a button with an image on it, so I should be better off with the MaterialPulseView. Closing this for now
— Reply to this email directly or view it on GitHub https://github.com/CosmicMind/MaterialKit/issues/87#issuecomment-164290407.
When I set the cardView divider property to false, the cardView just disappears, I had to set the divider color to clear color to get my desired look.