uibutton

UIButton in a UITabBarController crashing when clicked!

I tried to include a custom button programmatically inside a UIView which is a subview of UITabBarController. The button is displays fine but when I click it, it crashes without an error message. Its strange that sometimes it does inconsistently: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFSt...

Animated moving UIButton not responding to touches/taps while moving

Hi, I'm trying to animate a UIButton to move up the screen. At any point the user can touch it. However, it doesn't seem to respond to touches while moving, only at the start and end of its animation. I guess this is because the button itself isn't moving, just the image of it. Any ideas how I can solve this? Here's my code so far. Thank...

How can I detect a touch entering the frame of a UIButton?

Hi, I'm writing a class that implements a piano keyboard. Right now it's just a UIView and each key is a UIButton. I'd like the user to be able to drag their finger and hit several keys, but right now it only registers touch down. I've added UIControlEventTouchDragEnter as a way to trigger the key event but it only works if you hit a ke...

iPhone identify button pressed

Hi All! I have a view with several buttons that all have the same target and action. At the moment the action is @selector(doSomething). I need to be able to determine which button is pressed but I'm not sure of the best way to do this. The method doSomething is declared as... -(void)doSomething; Is there a better way to declare th...

iphone uibutton with square corners

How can I create UIButton in iphone app programatically to have square corners. I don't want to have rounded corners. ...

Pressing on a button causes UIScrollView to scorll

Hi, I'm having an inconsistent problem where sometimes I press on a button inside the scrollview. The scrollview catches the event and scrolls instead of the button getting the touch event. Any idea how to solve this bizarre behavior. Thanks ...

iPhone SDK - UIButton not working in custom view

This is driving me nuts... I've seen a few posts on similar issues but can't seem to make it work, so here it is: it is a very simple example, I am just creating a custom UIButton in a custom view, then assigning it a custom action to respond to touch events. When I run the app, the button is created, but nothing happens when I try to c...

Does iOS provide default selected appearence for controls?

I want to have an UIToolbar containing UIButtons with custom icons. As I can see, the highlighted appearence is provided (used when the button is being tapped). What I want is a default appearence for a selected icon (which I would control manually, bo [button setSelected]). According to HIG: Don’t include a pressed or selected app...

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 ...

custom image in UIButton

hi all. i have a problem with the uibuttons . i cant scale image to fit their frame . please any advice ...

how do i stop multiple uibutton pressing?

hi, imagine i have a UIView and to that i add 2 UIButton's i find that i can put a finger on one button, then, holding the first, i can touch the 2nd button with another finger. Both buttons will show their UIControlStateHighlighted images. Is there a way to stop the 2nd touch working? I thought that multipleTouchEnabled = NO was the ...

Objective-c iphone App, problems with button to parsed hyperlink

Hi! Another problem for me with my application is a simple procedure. I want to have a button which, if you press, opens the link associated with the article in question. I have followed instructions that i understand, but I am having trouble understanding why the link will not work. - (IBAction)link:(id)sender { WebViewController *vi...

On clicking the button to changed the view / Is need to use synchronous method in iPhone?

Hi friends, I have created scroll view and set the buttons in the scroll view. The buttons are scrolling horizontally. I created table view as subview for view controller. On clicking the buttons, the datas are displaying in the table view from RSS feeds using XML Parsing. SO changing the datas in the table view which depends the button...

iPhone AVAudioPlayer - play WHILE clicking, stop on lift of finger

Hi, I am using AVAudioPlayer and am trying to get it so while the user presses on the device, it continuously plays until their finger lifts up. My code is below: NSString *audioPath = [[NSBundle mainBundle] pathForResource:@"HahahaLong" ofType:@"mp3"]; primaryAudio = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPa...

UIButton touch is delayed when in UIScrollView

Hi All, I'm running into a small issue in my app. I essentially have a series of UIButtons added as subviews in a scrollview which is part of a nib. Every time I tap on a button there is a noticeable delay before the button is highlighted. I essentially have to hold it for about half a second before the button dims and appears selected...

Draw triangular UIButton on iPhone?

What would be the way to draw a triangular button on the iPhone. It would be nice if I could also change its parameters (backgroundcolor, font etc..) as with the regular buttons. Ideally I would like equilateral triangles. ...

how do I restrict UIButton title text from spilling over

Hi there, New to posting here but got many really useful bits of help already. I am shoving some text into a UIButton title ( UIButton setTitle: forState: ) I want only the first bit of the text to be displayed (ie only amount that fits). Currently, I am getting extra text spilling over into the view. Is there any easy way to help st...

Creating custom button with multiple labels

Is it possible to create a button with multiple labels? e.g. imageView, textLabel and detailTextLabel. I don't think it's possible using interface builder, but maybe we can do it programmatically by adding the UIImage and UILabels to button's view. If i do write a custom UIButton class, what's the best way to handle the state changes? ...

Moving an UIView when UIButton is pressed

hi, my view hierachy is following: BigView - UIScrollView - View 1 - View 2 - View 3 - UIView - UIButton now i want, that when i press the UIButton, the BigView (which includes the button as well) moves 100px to the top (so parts of the BigView aren't visible any longer) and another UIView gets visible at the free space under...

UIMenuController in custom UITableViewCell

I have a tableview that uses a custom UITableViewCell. In the cell, I have a button that shows a custom menu controller with three menu items. I would like to push a new view controller when you click the 'See Detail' button. I have this run when the 'See Detail' button is clicked in the custom cell - (void)seeDetail:(UIMenuControlle...