-
Notifications
You must be signed in to change notification settings - Fork 461
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
Button with corner-radius clips button text #266
Comments
Looking through the change history it appears as if this sub-layer application of corner-radius (and removal of layer.masksToBounds = YES) was introduced to allow shadow handling. |
* 'master' of https://github.com/tombenner/nui: Update to 0.5.5 Fixing objc_msgSend([UIColor class], selector); cause error: too many arguments to function call, expected 0, have 2, after upgrading to Cocoapods 0.36 Use iOS 7.1 simulator Only adjusting the corner radius of UIButton nested view's / layers (except UILabel) if a shadow-* property is set. This avoids and issue with clipping button text when using corner-radius (see tombenner#266) Add tests to cover setting background images from a subdirectory within the app bundle Add forward slash to list of characters allowed in a style value NUISegmentedControlRenderer: added support for custom sizes in segmented controls. NUIGraphics: removed hard-coded size from methods to create 'rounded rect layers'; a parameter is used instead.
There is an issue with this change: masksToBounds is set to NO for the button's layer. This effectively wipes out the corner radius setting. I think this should only be set on the layer of the subview which corresponds to the label only. |
When we style a button with a corner radius the text within it gets clipped on iOS7.1.
This isn't reproducible on iOS8.
E.g.
my-custom-button {
corner-radius: 14px;
border-width: 1px;
border-color: white;
}
The root cause of this appears to be due to the NUIButtonRenderer applying corner radius values to all of it's sub-layers including the UIButton's internal UILabel.
The text was updated successfully, but these errors were encountered: