uibutton

How to make UIButton clickable when it's out of bounds.

Hi guys, I set the clipsToBounds property of my UIView to NO, then I created a UIButton half in the bounds, and half out of the bounds. I found that only the part in the bounds is clickable. How can I make the whole button clickable? Any help would be appreciated. Thanks in advance. ...

UIButton location while zooming a UIScrollView

Hello: I have a "world view," so to speak, that consists of a large, zoomable area on a UIScrollView. I want several buttons to retain their world location when I pinch to zoom, much like pins in Google Maps do. The code I have been trying (I have been coding for hours, but I think it sounds right...although I may be just burned out) ...

UIButton won't go to Aspect Fit in iPhone

I have a couple UIButtons, and in IB they're set to Aspect Fit, but for some reason they're always stretching. Is there something else you have to set? I tried all the different view modes and none of them work, they all stretch. ...

How to resize UIButton to fit UIImageView?

I have a UIButton over a UIImageView. I want the button to adjust its size to fit the imageview. I tried a few different ways but can't get it. Anyone know how to do this? ...

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 joy. Is there an easy way to ...

How do I properly clean up a UIButton

I am having issues with UIButton with the iPhone SDK. I've determined that when I have a UIButton held down when the parent is removed (and the uibutton subsequently removed), I get some strange behavior. In my case, the app stops receiving any input whatsoever, as if the cleaned up held-down button has hijacked the input system someho...

UIButton.titleLabel clipping text problem

Hope I can get some help with a rather obscure problem with UILabel. I keep getting problems with clipping of characters. The font in the image at the link below is baskerville-bolditalic. The yellow is the rect that the UIButton is rendered in. The yellow is the UIButton's titleLabel.backgroundColor. http://img5.imageshack.us/img5/2381...

UITableView Cell - get IndexPath.row from button?

I currently have a button defined in a cell and a method to track its UITouchDown action as shown: - (void) clickedCallSign:(id)sender { int index = [sender tag]; NSLog(@"event triggered %@",index); } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath ...

Memory leak in UIButton setFont

Hi, Hope you all doing well, I am getting a memory leak while setting the font of UIButton. This is the code which I am using to set the font, [MyBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:12]]; whereas MyBtn is connected to IBOoutlet and I am not allocating memory to it. I don't see any thing wrong in the code. Hopeful...

How to rotate the imageView in a UIButton, and NOT scale it.

I am endeavouring to rotate the imageView property of a UIBUtton without scaling it. The image in question is 24x18 - wider than it is tall - but once rotated into place the image is being scaled to keep those dimension - leaving me with a very squished image. How can I prevent this? Below is my code .. -(IBAction)rotateButton { NSLog...

Add a second image to a custom UIButton

I've got an Custom UIButton. It's got a "static" background image a variable text (the Title) which gets set in the code Now I would like to add an icon (UIImage/UIImageView) inside the button on the left of the text. (I use the indent to move the text slightly to the right). Is there an easy way of adding that icon (and referencin...

UIButton only background slightly transparent

Is it possible to make just the background semi transparent? If I change the alpha it changes the title and the boarder. I can change the titleLabel.alpha property but it won't go above the buttons Alpha, only below it. I know I can make a custom one but thought there would be an easier way ...

UIView beginanimations: subview shall not animate

Hi I have a UIView to which I add a UIButton in its initWithFrame: method like this: UIButton * dropB = [UIButton buttonWithType:UIButtonTypeRoundedRect]; dropB.frame = CGRectMake(190, 22, 52, 22); dropB.backgroundColor = [UIColor clearColor]; dropB.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:11]; [dropB setTitle:@"DRO...

UIButton State (UIControlState)

How do I set the state of of UIButton ? In the UIButton class reference there is a "state" but it is only "readonly". Thanks James ...

What is the best method for creating a layer to catch touch events?

I need to put up an info screen above the main interface, but I need it to be alpha'd so you can see the interface underneath it. However, when I touch across the screen, the interface underneath is still running. What is the best method for intercepting the touch events so they don't pass through? I tried to add a custom UIButton the s...

ScrollView not scrolling when dragging on buttons

I have a scroll view that used to scroll when it didn't have buttons all over it. Now it does, and when dragging the mouse (on simulator) nothing happens (i think because the buttons are being pushed). How can I make this right? ...

why do my programically generated buttons NOT attach themselves to the current view?

The code below generates a button and places it on the screen; button = [UIButton allow] initWithFrame:CGRectMake(0.0, 0.0, 20.0, 20.0)]; button.frame = CGRectMake(0.0, 20.0, 10.0, 40.0); button.backgroundColor = [UIColor redColor]; [self.window addSubview:button]; However, when I generate a new screen via "pushViewController:animated"...

How to load a new view within a view controller when a uibutton is tapped

Hello, I'm creating a tab-based app. I want one of the tabs to include the following: -Have a set of UIButtons -When you click on one of the buttons it loads a view beneath the buttons -Each button has a different view -No navigation controller just load the view on the same page without animation -Still can click on the other buttons ...

How can I forward touches to a UIButton from another UIView?

I have a UIButton and a UIView. The View sits above the button, and is larger than the button in size. The view itself is what I want to have accept the touch events, and I'd like to forward them to the button, so that all the normal button visual changes on touch happen. I can't seem to make this work-- my UIView implements touchesBeg...

can't click UIButton when it's added to UIImageView

guys, i want to click my uiButton after it's added to UIImageVIew, but it doesn't work. this is my code : UIButton *btnDetail = [[UIButton buttonWithType:UIButtonTypeDetailDisclosure]retain]; btnDetail.frame = CGRectMake(0,0,100,100); [btnDetail addTarget:self action:@selector(buttonClicked) forControlEvents:UIControlEventAllTouchEvent...