uibutton

custom properties for UIButton (iphone sdk)

I have created a subclass for a UIButton and was hoping to pass a custom property to it. However, it's not working and I've since read that subclassing a UIButton isn't a great idea. MY question is how do I assign a custom property to a button? I am creating a button which is being placed in the headerview of a grouped table. I want to ...

Redrawing UIControls/UIButtons on iPhone in BubbleLevel example code

I'm confused about when -setNeedsDisplay should be called by me. As an example, for updating a button with different images between presses (toggling between the two), the example code from Apple shows -setImage being called on a UIButton. There's no call to -setNeedsDisplay that I can find after that, though. So do UIControl methods all...

How is a UIButton's image set programatically?

How does one set the image of a UIButton from within the code? I try the following but it just leaves the button as a white square. [A1 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"m1.10001.png"]] forState:UIControlStateNormal]; Thanks ...

UIButton scale on touch?

hil, can someone tell me how i can scale an UIButton on touch? the button should scale up like 10%. thanks in advance! ...

iPhone: UIButton don't use default pressed highlight

Currently when you use a UIButton and press down on it, it gives the button a dark overlay as an indicator that the button was pressed. I don't want this as I am implementing my own pressed state. How can I remove this default? ...

when i create a button with identifier,action parameters is giving error

stop = [[UIButton alloc] style:UIButtonTypeCustom target:self identifier:stop action:@selector[webView stopLoading]]; when i am using this is giving syntax eerror : is expected ...

Dragging and resizing UIImages or UIButtons.

How does one take a UIButton or UIImageView and make it editable at runtime? I would like the user to be able to move small UIImageViews or UIButtons around the screen, resizing them, dragging them etc. I would like to make the corners of the squares or rectangles able to handle user interaction so that they can resize using the corner...

Button event handling in ResponderChain

Hi, I've got a simple view with an UIButton on it. In my ViewController, TouchesBegan catches all touches as expected, just the button-hit doesn't do anything (besides flashing nicely blue ^^). I'm asking to clarify, I'm aware, that I could (and probably should) link the button to an action. But shouldn't the button fire a touch-event a...

iPhone - Change UISearchDisplayController "Cancel" button text

Sort question: Is there a way to change the "Cancel" button text within a UISearchDisplayController to "Done" or "Close"? Rationale: I have a UITableView that contains a list of options, each option can be checked or unchecked. I want to enable search through these options, so I've created and added a UISearchDisplayController. The...

iPod detail view icon

So I'm having the hardest time figuring out what this thing is called, or where I can find it. I have an app where I would like to use this icon, or button or whatever it is, but I can't find it in Apple's system supplied buttons. Here is a picture of the icon I'm looking for (it's in the red circle): I know that Pandora uses this sa...

Draw graphics inside a UIButton

I have some (fairly large) UIButtons. Instead of text, I would like to draw some simple colored graphics inside them (lines, boxes). How can it be done without resorting to using prerendered images? ...

UIButton with NSInvocation

I am trying to add a button programatically in a way that upon pressing it, a certain object is being passed. I keep on getting "unrecognized selector sent" exception. Can you suggest whats wrong with the code: // allocate the details button's action SEL selector = @selector(showPropertyDetails:forProperty:); NSMethodSignatu...

Custom uibutton in ARKit programmatically ..

I am playing around with the ARKit API ...I wanted to add Custom UIButton within the box on the right side which appears on the screen generated by the code below in the app delegate : #define BOX_WIDTH 350 #define BOX_HEIGHT 150 - (UIView *)viewForCoordinate:(ARCoordinate *)coordinate { CGRect theFrame = CGRectMake(0, 0, BOX_WIDT...

IPhone set Text of button and also the position of the text

Hi I would like to ask how to set the text of a button whilst also specifying the position and colour of the mentioned text. Thanks ...

UIButton in UITableView problem

Hi I am trying to create a list of options with check boxes. I am using UITableView and adding custom type buttons to the table as check boxes. My code for cellForRowAtIndexPath method is pasted below. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier...

pass scroll event from uibutton to uiscrollview

hi all, i have horizontal scroll view which is extended from UIScrollView and i added uibuttons horizontally. i can only scroll out of the buttons area, but if i want to scroll over any buttons is fires UIControlEventTouchUpInside event. i dont want this. i want to fire UIControlEventTouchUpInside action if i click and i want to scroll i...

UIButton target size

The Human Interface Guidelines says "Create controls that are at least 29 pixels high and provide a target area that’s 44 pixels high". So I was wondering when I use an UIButtonTypeCustom with stretchable Background Image and Text, is there a way to set the target area? Just changing the buttons frame to 44 pixel stretches the backgrou...

When you tap a uibutton a certain header comes up based on the button you tapped?

For example lets say you have list of sports 1.Football 2.Baseball 3.Basketball you click on one of those it brings your up to a choice of 1.Schedule 2.Stats 3.Coaches then you click on coaches and up comes a uitableview with all of the coaches for each sport football, baseball, basketball, separated by a header for each sport. How...

iOS: How do I create irregularly shaped / partially transparent & click-thru buttons

How would I create these buttons, so that clicking handles correctly? Each button is a .png, transparent outside of the coloured square. I need a transparent areas to be click-thru. ...

Identifying what UIControlEvents was triggered by UIButton (or other widget).

I have defined the following method: - (IBAction)actionPerformed: (id)sender { ... } and registered it with several widgets (UIButtons mostly) on a view. I'd like to log a message telling me who triggered which UIControlEvents, e.g. NSLog( @"The following: %@ was triggered by %@\n", <control events>, <button identifier> ); I don't ...