Comments (4)
@Adarkas2302 Yeah I noticed the same thing, it worked fine for iOS 11.
Try something like this:
let systemVersion = UIDevice.current.systemVersion
if systemVersion.contains("12.") {
button.setTitle(" Sale", for: .normal) // there are 4 spaces for iOS 12 or greater
} else {
button.setTitle("Sale", for: .normal) // this is how it should normally work
}
Of course if there is anyVersionLessThenTwelve.12.x this will be true
from dlradiobutton.
This is a choppy fix but it works for because everything else I tried didn't work. Inside the saleButton closure, I had to add 4 empty spaces before I set the string for the title:
I changed this:
button.setTitle("Sale", for: .normal)
to this and the spacing is now correct
button.setTitle(" Sale", for: .normal) // there are 4 spaces
from dlradiobutton.
I have the same problem. It seems that it is not influenced by the version of DLRadioButton but by the iOS Version. With the same build in iOS 11, the marginWidth seems to work correctly.
from dlradiobutton.
Thanks for the help, I did it like this already.
from dlradiobutton.
Related Issues (20)
- Context stack bug. HOT 3
- Radio button is not getting rendered in table view
- nil returned from a method that is expected to return a non-null value
- Radio Button Appearance Issue HOT 3
- No Such Module fatal error in XCOde 10 HOT 1
- Is it good idea to change layout/appearance attributes in -drawRect?
- Margin Width in Localization HOT 3
- how to use
- Unable to set the button selected when it's not enabled HOT 1
- How to restore the state of DLRadioButton while navigating from one controller to other?
- Save button behaviour
- RTL Localization Button title position is distrubed HOT 2
- Attributed titleLabel not showing
- Programmatically create DLRadioButton
- Dark mode & Light mode HOT 1
- Use of undeclared type 'DLRadioButton' HOT 1
- DLRadioButton used in TableviewCell is defaulted to "selected" when cell is loaded HOT 2
- drawButton method has deprecated member variables
- Glow effect.
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 dlradiobutton.