Tag: uibutton

Tableviewcell button

I have tableview , where I subclassed tableviewcell. There is a horizontal scrollview in the cell and I add dynamic button to the scrollview. My requirement: 1. When I tap the button(s) on row0 for the first time, I need to set a different BG color for the tapped button and add the button index […]

A UIButton in my subview won't work

I’m Creating a custom UIView called InfoAboutBlockView, I’m adding it to my ViewController and it added correctly but when I’m pressing a button inside that custom UIView it won’t fire. I’m creating a xib file in which I design the UIView and then I create the .h and .m files InfoAboutBlockView.h: #import <UIKit/UIKit.h> @interface InfoAboutBlockView […]

Coloration of UIButtons of type UIButtonTypeRoundedRect

I would like the rounded rectangle portion of the subject type of UIButton to be a solid custom color I specify. I understand that . setTitleColor : changes the text color . backgroundColor : changes the color of the four pie-shaped corner pieces behind the rounded rectangle The question is how to change the color […]

How to add UITextfield on click of UIButton and make it editable

I have a UIButton and I am trying to develop an editable UITextField onclick of UIButton. Basically, I want the user to click on the button and edit the text and save it for future use. So currently I have: [notes_button addTarget:self action:@selector(editNote) forControlEvents:UIControlEventTouchUpInside]; I am not sure how to get a popup like UITextField […]

Put Random UIButtons Title of NSMutableArray to UIButtons of NSMutablearray

I have an NSMutableArray with 3 UIButtons and Second NSMutableArray with 50 UIButtons. I want to take these 3 UIButtons Titles to Assign it Character by Character to each UIButton of SecondArray.but Each of these 50 UIButtons of Second Array already have single Character.My Basics purpose is that first of all i want to check […]

How to make an iPhone dropdown-looking button

I’ve seen a dropdown-like button on many apps, including Turf Wars, that simulates a dropdown with a picker. I need to use the same functionality in my app, but I’m not too sure what the best way to go about it may be. Example: I figured I could make two images and set them as […]

UIControl – changing assigned selectors: addTarget & removeTarget

I’m using 10 buttons in my interface and need, from time to time, to change the button’s selector. Am I required to use: -(void)removeTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents before I change the selector or can I just use: -(void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents I’m concerned that if I change the selector using the addTarget: method sans the removeTarget: method […]

toggle UIButton-state when pressing, like a switch

-(void)setState:(id)sender { UIButton* button = (UIButton*)sender; BOOL buttonBool = ([button state]==selected : YES ? NO); [sender setSelected:buttonBool++]; } this is my idea, but i cant figure out the actual state of the button calling the funktion. any button, that calls this funktion, should be toggled between default and selected-state, so that it works like a […]

Avoiding making a UIButton transparent/see-through when disabling it

I want to disable my UIButton, so I call: button.enabled = FALSE; However this makes the button see-through and I can see the elements underneath it. I don’t mind that it changes colour, I just don’t want it to be see-through. I’ve tried ticking the boxes for ‘opaque’ and ‘clip subviews’ in IB, but no […]

Is it possible to successful animate a moving UIButton?

I’m trying to animate a button which moves around the screen. At any point, the user can push the button. But the button doesn’t respond to touches. I’ve tried an animation block but the button simply moves immediately to its end coordinates, while the frame shows the animation (the button is called bubble): [UIView beginAnimations:nil […]