Need to place icon as button at the top right of the label in swift - swift4

I tried to put the image as button at the top right of the label that yo out side the label with autolayots but when I run the app the button would be too far from the text . But I need the button to apper exactly after text at top-right.I want something like in the imagebutton at top right of label

Related

how to remove the black border in the toggle button when appeared in it is clicked?

enter image description here
I tried to remove that black border that appear when I clicked the toggle button, but I cant find the solution, Im using bootstrap5, please give me a solution
Just use "shadow-none" class on button and it will remove it.

Button obscured by another Button can't be pressed

There are 2 buttons - Button A and Button B.
Button B is situated on top of Button A.
Button B has it's Button Component removed.
I want the user to be able to click on Button A even though Button B obscures it.
How can I achieve this?
Not sure What is your question but if you want to click start button while air button is above it. you should disable the option on button called Interactable and also uncheck the toggle in image component of that button called Raycast Target. and that will do it.
Of course Button B button will block the one underneath it. Because Image component and Text and/or other Image component that button has blocks raycast to the button underneath of it.
You can do one of the following:
Remove your Button B button, because if it's not doing anything and actually interferes with a behavior you want then why have it in the first place? Think about it
Uncheck Raycast Target in your Button B button's Image component
Disable Image component of Button B button altogether
Thinking about first item on the list will benefit you greatly.
If you want a solution then use second or third option on the list, but bare in mind that unchecking Raycast Target or disabling Image component of your "Air" button still leaves an Image and/or Text as a child of aforementioned button that CAN and WILL block raycast to your Button A button.

Make Button NOT change title color when pressed

I can't find any other question on how to prevent this, and nothing I've tried is working perfectly.
I want to make it so the title color of the text on my button is ALWAYS white (I will do some other styling to make this look good still).
But, every time I press on the button, the title color changes from white to grey. How can I stop this? Preferably in the storyboard file instead of programmatically.
Images for illustration:
Not pressed:
Pressed:
Select -> Type: Custom in Attributes ispector

Display a label directly on a button

I see many posts explaining how to display a label after clicking on a button but it seems nobody has raised the question of how to actually display the label text directly ON the button itself.
I am coding for the AppleWatch and due to the small screen size, it would seem that saving space and actually having the label display on the button instead of above or below or to one of the sides to be something of a perfect solution.
Specifically, what I am trying to do is create a tap counter with the incrementing number be on the button itself. Tap the number (or button) and it increments by one.
Possible?
You can create a label with transparent background, and place it on top of a button.
However, this is not an ideal solution: rather than displaying a label on top of a button, you could change the text of the button itself. This way you would have the same visual effect with fewer objects on the screen:
button.setTitle("Text you wanted on the label", forState: .Normal)

Icon/image over UIButton iPhone

If I want an image on my UIButton, and I still want to use the default white button. Is it ok to add an image(icon) over some parts of the button?
I have a button with the text 'Show on map' and I want a icon to the right.
Is this the only approach or are there other possibilities? When I add an icon over the button some parts of the button won't be "clickable".
Thanks in advance.
you could create a custom button that has an image the 'icon' and then the rest is transparent and then overlay this button over the standard one and give them the same action.
An easier way would just to be create an image that is the button exactly as you want it and use the 'custom button' style and use this as the backgroundImage.