|
CGContext always creating a black rect.
Hi. I’m trying to draw a bezier shape in CGContext on a UIView in Swift with a transparent background and the background is always black. Nothing online helps.
Any ideas? I’ve checked
Hi. I’m trying to draw a bezier shape in CGContext on a UIView in Swift with a transparent background and the background is always black. Nothing online helps.
Any ideas? I’ve checked
|
By
Alex Zavatone
·
#1408
·
|
|
Re: Help with iOS 15-style UIButton?
Hi, Alex.
The work-around was to force the button width to be "expectedWidth" (which is the width of the [unwrapped] text + image padding + image width + 8 points of slop (to account for button
Hi, Alex.
The work-around was to force the button width to be "expectedWidth" (which is the width of the [unwrapped] text + image padding + image width + 8 points of slop (to account for button
|
By
Rick Aurbach
·
#1407
·
Edited
|
|
Re: Help with iOS 15-style UIButton?
And what is, "mirrow above bounds code”?
And what is, "mirrow above bounds code”?
|
By
Alex Zavatone
·
#1406
·
|
|
Re: Help with iOS 15-style UIButton?
Could you point out the specific workaround please?
Could you point out the specific workaround please?
|
By
Alex Zavatone
·
#1405
·
|
|
Re: Help with iOS 15-style UIButton?
I haven't filed a bug yet, but I will. In the meantime, I've constructed the following work around — it's a hack, but it seems to work.
I haven't filed a bug yet, but I will. In the meantime, I've constructed the following work around — it's a hack, but it seems to work.
|
By
Rick Aurbach
·
#1404
·
Edited
|
|
Re: Help with iOS 15-style UIButton?
Can you file a bug?
Maybe they will fix it before iOS 15 is released.
Jeremy
—
Can you file a bug?
Maybe they will fix it before iOS 15 is released.
Jeremy
—
|
By
Jeremy Hughes
·
#1403
·
|
|
Re: Help with iOS 15-style UIButton?
Thanks for the heads up. That’s crappy.
Thanks for the heads up. That’s crappy.
|
By
Alex Zavatone
·
#1402
·
|
|
Re: Help with iOS 15-style UIButton?
Good thought. I'll give it a try.
Re: your "do you have to use the API" remark, the simple answer is that if your deployment target is iOS 15, you ARE using the API, whether you like it or not. There
Good thought. I'll give it a try.
Re: your "do you have to use the API" remark, the simple answer is that if your deployment target is iOS 15, you ARE using the API, whether you like it or not. There
|
By
Rick Aurbach
·
#1401
·
|
|
Re: Help with iOS 15-style UIButton?
Can you set up an observer to watch and see if it’s changed and then change it back? Seems like a real hack, but it’s a thought.
Can you set up an observer to watch and see if it’s changed and then change it back? Seems like a real hack, but it’s a thought.
|
By
Alex Zavatone
·
#1400
·
|
|
Re: Help with iOS 15-style UIButton?
My god, that sucks. I can’t believe this wasn’t tested. We've actually been building custom UI classes for the past month and am familiar with the pain.
Do you have to use the new API?
My god, that sucks. I can’t believe this wasn’t tested. We've actually been building custom UI classes for the past month and am familiar with the pain.
Do you have to use the new API?
|
By
Alex Zavatone
·
#1399
·
|
|
Re: Help with iOS 15-style UIButton?
The problem is unique to the new iOS 15 UIButton API. There is no problem in my logic if the deployment target < iOS15.
Specifically,
I tried setting a constraint on the height of the button. It is
The problem is unique to the new iOS 15 UIButton API. There is no problem in my logic if the deployment target < iOS15.
Specifically,
I tried setting a constraint on the height of the button. It is
|
By
Rick Aurbach
·
#1398
·
|
|
Re: Help with iOS 15-style UIButton?
I did this in UIKit by making the button’s frame.size.width the frame.size.width of the content within + appropriate space buffers.
One trick is if the text component is a UILabel, making the lines
I did this in UIKit by making the button’s frame.size.width the frame.size.width of the content within + appropriate space buffers.
One trick is if the text component is a UILabel, making the lines
|
By
Alex Zavatone
·
#1397
·
|
|
Help with iOS 15-style UIButton?
I am trying to construct a button using the new iOS15 button API. (Xcode 13ß3, UIKit & Storyboards)
The button has a title (aligned .leading) and an image (aligned .trailing). The button has the
I am trying to construct a button using the new iOS15 button API. (Xcode 13ß3, UIKit & Storyboards)
The button has a title (aligned .leading) and an image (aligned .trailing). The button has the
|
By
Rick Aurbach
·
#1396
·
|
|
Re: Layers and shadows. Is it possible to have a layer with a shadow and no background color?
But that’s exactly what I want. I want to add a shadow to an item with no opacity. I am specifying the shadow path as a bezier path so that I can overlay an additional shadow over a UIView.
We
But that’s exactly what I want. I want to add a shadow to an item with no opacity. I am specifying the shadow path as a bezier path so that I can overlay an additional shadow over a UIView.
We
|
By
Alex Zavatone
·
#1395
·
|
|
Re: Layers and shadows. Is it possible to have a layer with a shadow and no background color?
Sure — but it doesn’t matter how opaque the shadow is. An object with zero opacity won’t have a shadow (in real life or in computer graphics).
Imagine some opaque text on a transparent
Sure — but it doesn’t matter how opaque the shadow is. An object with zero opacity won’t have a shadow (in real life or in computer graphics).
Imagine some opaque text on a transparent
|
By
Jeremy Hughes
·
#1394
·
|
|
Re: Layers and shadows. Is it possible to have a layer with a shadow and no background color?
But it’s odd, since I set the shadow opacity to 1, which is 100%. Adding multiple shadows to a UIView is a royal PITA without a CGFilter since you can’t make an empty layer and apply a shadow to
But it’s odd, since I set the shadow opacity to 1, which is 100%. Adding multiple shadows to a UIView is a royal PITA without a CGFilter since you can’t make an empty layer and apply a shadow to
|
By
Alex Zavatone
·
#1393
·
|
|
Re: Layers and shadows. Is it possible to have a layer with a shadow and no background color?
That’s what I would have expected: a transparent object produces no shadow, while a semi-transparent object produces a weak shadow.
It’s analogous to real-life objects.
Jeremy
—
That’s what I would have expected: a transparent object produces no shadow, while a semi-transparent object produces a weak shadow.
It’s analogous to real-life objects.
Jeremy
—
|
By
Jeremy Hughes
·
#1392
·
|
|
Re: Layers and shadows. Is it possible to have a layer with a shadow and no background color?
Well, it was worth a shot. The shadow is barely visible even if I use a shadowOpacity of 1.
Well, it was worth a shot. The shadow is barely visible even if I use a shadowOpacity of 1.
|
By
Alex Zavatone
·
#1391
·
|
|
Re: Layers and shadows. Is it possible to have a layer with a shadow and no background color?
I said .01%, not 1%. I doubt the naked eye will detect that little of a change.
Steve via iPad
I said .01%, not 1%. I doubt the naked eye will detect that little of a change.
Steve via iPad
|
By
Steve Mills
·
#1390
·
|
|
Re: Layers and shadows. Is it possible to have a layer with a shadow and no background color?
What I’ve been doing is duplicating the layer, a task unto itself, adding the layer on top of or behind the previous layer and then getting a shadow that way. It’s not perfect but it’s
What I’ve been doing is duplicating the layer, a task unto itself, adding the layer on top of or behind the previous layer and then getting a shadow that way. It’s not perfect but it’s
|
By
Alex Zavatone
·
#1389
·
|