Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Label corner radius not doing anything
-
I change a button's corner radius just fine. Why won't a label's corner radius change? Do I have to do something special with the border or frame first?
lbl = ui.Label() lbl.frame = (20,20,100,100) lbl.corner_radius = (5)
-
You also need
lbl.border_width = 1
-
Thank you, this helped. The results were not as expected though (my fault). A border with a radius was indeed created; however, the sharp white label corners were still present as well. Hmmm
My solution was to use a text view and that worked better.
-
Looks like a bug to me.
-
Here is what I mean:
-
The reason is basically that labels don't clip their content by default (I think this has changed in iOS 8 due to improved support for some Asian languages), and there's currently no way to change that (well, in the 1.6 you could technically do it via
ctypes
, but it requires quite a lot of code...) The easiest workaround would be to embed a label in aui.View
(i.e. make it a subview of a view that clips).