Hi,
I have added a square image inside a UIButton.
The goal is to have the square image on the left of the button, with space margin around 4 sides of button = 5.
Here is the code:
button.imageView?.contentMode = .scaleAspectFit
button.contentHorizontalAlignment = .left;
button.imageEdgeInsets = UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5)
and here is the result:
You can notice several problems:
Right margin is > 5 (between button and text)
Left margin > 5
The rest, aspect, and top and bottom margins are fine.
How to have this button well on the left, and the text right next to it?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
I want users of a swiftui app to be able to enter text in a field, and to:
Change text style
Change text size
Add bullet lists
What's the general direction I should take to implement this, possibly without using an external library?
Hi,
I managed to have a nested list in swiftui 3 (with foreach) and drag and drop to reorder the list when I enter the built-in edit mode.
Problems / limitation when dragging / dropping a list item from edit mode:
I can't change its nesting level: for example, if I drag an item that is 3 nested levels deep, I can't seem to be able to drop it on let's say level 1.
When an item has children, and they are expanded, if I drag the father, the children will not follow.
I can't drag from one section, and drop on another.
What are the solutions to circumvent those problems?
Is there built-in way to do it, if not, is it even possible without resorting to UIKit?