I have background image for every cell of table view, when i swipe delete button appears, the problem is that a square of white color(default cell color) appears behind the delete button, i want to get rid of that white square, so how to clear background color of delete button?
If u have create button dynamically then use react round type button. if u have same problem then u choose custom type button. If u have drag and drop then unchecked opaque quality of button in view section.
Related
I have two views. After clicking on the button in the first view, a popup window appears (second view). In it, if a user does some action, the popup disappears, and the user is once again in the first view and the button is of a different color (which is great!). However, when I touch down on it and move the finger away (so I won't click it) it changes back to its initial color. The same happens when an alert appears in the window - the button changes back to its initial color. Any help?
I changed the color of the button through delegate and line:
cell.btn2.titleLabel?.textColor = UIColor.gray
Use cell.btn2.tintColor = UIColor.gray to change the tint color, rather than directly affecting the titleLabel's textColor.
So, I want to add a button over existing image, but what I want is - when I tap on map (in this case), I want this red button to show up at the place where I tapped. I want it in SWIFT.
https://www.dropbox.com/s/3oei04rsmf2xh99/Screenshot%202015-02-20%2013.42.17.png?dl=0
I want my titleLabel text move a little down on button tap (i.e. I want to give different inset values for highlighted and default states).
I have custom button background images and the button goes down in highlighted state image but the text on it stands at the same place so it gives a bad effect and looks like the text is seperated from button.
Is there any way to solve this?
Thanks in advance
The easiest way to do this is to put your text on the button's background image.
If you can't do that for some reason you can try to add IBAction on Button down and adjust button.titleLabel.frame.
I am making multiple custom buttons that look much like this:
It is a simple button with either the green or gray in the "indicator view". What I need some explanation for is: In interfacebuilder there are four states a button can have; Normal, Highlighted, Selected and Disabled. When I provide images for everything except disabled I thought that normal would be when no touches were made on the button, highlighted is while you hold your finger on it and selected would be when after you release finger.
However I do not think thats right now. I use the touch-up-inside event. Is it correct that I need to set the selected/highlighted etc property on the button?
Thank you for your time.
You might want to set to selected and not highlighted.
Highlight is darkening the button for a fraction when touching the UIButton. UIButton can modify your image automaticaly so usually you don't need to provide a highlight image.
Disabled is when it is disabled.
Selected is when it is selected. You can invert the select flag on touch up inside event to make a state button.
[button setSelected:![button isSelected]];
Yes, you need to respond to the touch up inside by setting the button to highlighted.
Btw, it's "disabled" not deselected, but it doesn't sound like you need that state.
How do you change the clear button color of a UITextField?
You want to use rightView and rightViewMode. Use a button and add an image that is a red clear button. Then add your target and perform your logic.
rightViewRectForBounds will also return the size of the button for the rightView.