Search Results

Search found 447 results on 18 pages for 'uibutton'.

Page 7/18 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • How do I hide the text on a label in Obj-C?

    - by dbonneville
    I'm using label of a button to send a value into a function. However, I want the button to be invisible. I have the background color turned of in IB, and the text color is also set to nothing, but the text still shows up on the button. Is there another way to have a clear button that sends a value when it's clicked? If I could just turn off / hide the text on the stock UIButton that would be perfect... Thanks, Doug

    Read the article

  • How we can perform Action on Sequence UIButtons?

    - by Prince Shazad
    As My Screen shot show that i am working on word matching game.In this game i assign my words to different UIButtons in Specific sequence on different loctions(my red arrow shows this sequence)and of rest UIButtons i assign a one of random character(A-Z).when i Click on any UIButtons its title will be assign to UILabel which is in Fornt of Current Section:i campare this UILabel text to below UILabels text which is in fornt of timer.when it match to any of my UILabels its will be deleted.i implement all this process already. But my problem is that which is show by black lines.if the player find the first word which is "DOG". he click the Two UIButtons in Sequence,but not press the Third one in Sequence.(as show by black line).so here i want that when player press the any UIButtons which is not in Sequence then remove the previous text(which is "DO") of UILabel and now the Text of UILabel is only "G" . Here is my code to get the UIButtons titles and assign it UILabel. - (void)aMethod:(id)sender { UIButton *button = (UIButton *)sender; NSString *get = (NSString *)[[button titleLabel] text]; NSString *origText = mainlabel.text; mainlabel.text = [origText stringByAppendingString:get]; if ([mainlabel.text length ]== 3) { if([mainlabel.text isEqualToString: a]){ lbl.text=@"Right"; [btn1 removeFromSuperview]; score=score+10; lblscore.text=[NSString stringWithFormat:@"%d",score]; words=words-1; lblwords.text=[NSString stringWithFormat:@"%d",words]; mainlabel.text=@""; a=@"tbbb"; } else if([mainlabel.text isEqualToString: c]){ lbl.text=@"Right"; [btn2 removeFromSuperview]; score=score+10; lblscore.text=[NSString stringWithFormat:@"%d",score]; words=words-1; lblwords.text=[NSString stringWithFormat:@"%d",words]; mainlabel.text=@""; c=@"yyyy"; } else if([mainlabel.text isEqualToString: d]){ lbl.text=@"Right"; [btn3 removeFromSuperview]; score=score+10; lblscore.text=[NSString stringWithFormat:@"%d",score]; words=words-1; lblwords.text=[NSString stringWithFormat:@"%d",words]; mainlabel.text=@""; d=@"yyyy"; } else { lbl.text=@"Wrong"; mainlabel.text=@""; } }} Thanx in advance

    Read the article

  • Is it even possible to change a UIButtons background color??

    - by dubbeat
    Hey, This one has me stumped. Is it possible at all to change the background color of a UIButton in Cocoa for iphone. I've tried setting the background color but it only changes the corners. SetBackgroundColor seems to be the only method available for such things. Please refer to my screen shot [random setBackgroundColor:[UIColor blueColor]]; [random.titleLabel setBackgroundColor:[UIColor blueColor]];

    Read the article

  • Numerous buttons in a view

    - by mindfreak
    Hello, I want to create 25 buttons in my view. Should I create 25 buttons(UIbutton butonwithtype) individually or is there any other alternative ? Pl. comment if the Question is not understood by you.

    Read the article

  • resignFirstResponder when tapping UITableView?

    - by Canada Dev
    I have a UITableView with two custom cells and each of them has a subview with a UITextField inside it. I have tried adding a UIButton on top of the UITableView and have it resignFirstResponder but that just means you won't be able to tap anywhere else - not even on the UITextFields to enter text. How do I make it so if I tap outside those two UITextFields, I can call resignFirstResponder, so the user can get back to the other cells? Thanks

    Read the article

  • buttons and menu items in cocos2d/objective-c

    - by peter61
    In my app, I'd like a method called whenever the user taps the screen (anywhere on the screen). Normally, I'd make a transparent UIButton that covers the whole screen. If I'm using the cocos2d framework, what's the best way to do this? Is it good practice to still use UIButtons? I've been reading about MenuItems but haven't found an easy way to make one giant fully transparent menu item? Thanks.

    Read the article

  • Updating UILabel and UIButton immediately

    - by paul simmons
    Hi, In a project, I change a UILabel's text with setText, a UIButton's color and after that do a time consuming calculation, followed by an animation. However, the text's and color's change is reflected after the calculation is executed (and before the animation begins) however I want to reflect the changes immediately before calculation (as you guess it is a waiting text) How can I achieve this?

    Read the article

  • How can I locate the indexpath of the UITableviewCell a certain button is in when I click that butto

    - by Jake
    I've added a button as an accessory view to uitableviewcell, and I when I press it, I'd like to be able to access the index path of the table view cell it's currently inside of so I can delete/modify the contents of that cell. Should I subclass UIbutton and add make it have it's own index path property? If so, do I need to implement any specific button methods in that subclass of will they automatically be loaded? Any help would be greatly appreciated. Sorry if this is a noobie question.

    Read the article

  • Can’t tap button after interface rotation

    - by zoul
    Hello! I’ve got a view that has to be presented both in landscape and portrait. The transition between different orientations is done by repositioning and resizing the subviews. One of the subviews is a button (plain UIButton with an image background). When the interface rotates to landscape, the button starts misbehaving – it can only be tapped on its left part, the right part does not respond. When I move the button a bit to the left, the tappable part grows. The button should not be obscured by any other view, it’s clearly visible. When I override the hitTest:withEvent: method in the parent view, I see that the taps in the “numb” part of the button result in nil being returned. I think I have seen this behaviour once before, but unfortunately I’ve forgotten the source of the problem :) Any help?

    Read the article

  • UIButton that cycles through images when clicked

    - by dot
    I have three images that I want to cycle through when clicking on a UIButton. How would I go about doing this? This is what I have so far, but it's not really working. //the images NSString* imageNames[] = {"MyFirstImage", "AnotherImage", whatever else}; int currentImageIndex = 0; and - (IBAction)change{ UIImage* imageToShow = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource: imageNames[currentImageIndex] ofType:@"png"]; if( currentImageIndex++ == sizeof(imageNames)/sizeof(NSString)) //check to see if you hit the last image { currentImageIndex = 0; //start over } } Ideas? Any help will be greatly appreciated! Thanks!

    Read the article

  • How can I play video by touching the button on the video thumnail of the video in tableviewcell ?

    - by srikanth rongali
    I have a table view in which if each cell is touched video plays. Each cell have image of the video cell.imageView.image. And on the image I have a button (UIButton) with play symbol. If I touch the play button the corresponding video should be played same like the when cell is touched. I have a selector for the play button. But I need (NSIndex*)indexPath to get the current row. But I can't access the indexPath in my selector. How can I make this? Thank You.

    Read the article

  • Add programmatically clickable Button with custom Views layouted in InterfaceBuilder

    - by allisone
    I have a UIScrollView. In there I add buttons programmatically. Right now I just use UIButton and set one title. But I need to have an UIImage View in there, that will change upon certain events, Text that will change too etc. and I would like to style that in Interface Builder, but I can't figure out how to do this. Which class should I extend, and what kind of xib should I create and what in there, so that in the end I can make the right connections and so that I can listen for UIControlEventTouchDown of that Button.

    Read the article

  • UIButton custom font vertical alignment

    - by Willshaw Media
    I've got a UIButton which uses a custom font, which is set when my view loads: - (void)viewDidLoad { [super viewDidLoad]; self.searchButton.titleLabel.font = [UIFont fontWithName: @"FONTNAME" size: 15.0 ]; } The problem I've got is that the font is appearing to float up of the center line. If I comment out this line, the default font appears vertically centered fine. But changing to the custom font breaks the vertical alignment. I'm getting the same issue on a Table Cell with a custom font too. Do I need to tell the view somewhere that the custom font is not as tall as other fonts? EDIT: I've just realized that the font I'm using is a Windows TrueType Font. I can use it fine in TextEdit on the Mac, only a problem with the alignment in my App

    Read the article

  • Stubborn UIButton

    - by Mike
    I have a UIButton that is supposed to be disabled during certain phases. So, when this happens I do [myButton setEnabled:NO]; This is perfect because the button stays grayed and if clicked will not trigger its action, but... when the button is clicked even grayed, it enables again and a second click will trigger its actions (???????!!!!!!!!!!). How can that be? If the button is disabled it is supposed to be "part of the background", i.e., an image without any action. I have tried to make the button vanish using alpha but even if you click on the empty spot, it reappears after the first click and then can trigger actions after the second click... (????) Am I missing something?

    Read the article

  • Why does initWithFrame have the wrong frame value?

    - by greypoint
    I have a subclass of UIButton called INMenuCard and I am overriding the initWithFrame to include an activity indicator. The menuCard places correctly but any internal reference to "frame" give me "inf,inf,0,0" which means my activityIndicator subview is not placed correctly. What might I be missing? @implementation INMenuCard - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { CGRect innerFrame = CGRectInset(frame, 50.0f, 100.0f); activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:innerFrame]; activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite; [self addSubview:activityIndicator]; } return self; } I am instantiating INMenuCard with (debugging shows the CGRect values are correct): CGRect cardFrame = CGRectMake(cardX, cardStartY, cardWidth, cardHeight); INMenuCard *menuCard = [[INMenuCard buttonWithType:UIButtonTypeCustom] initWithFrame:cardFrame]; [theView addSubView:menuCard];

    Read the article

  • How can I play video by touching the button on the video image of the video in tableviewcell ?

    - by srikanth rongali
    I have a table view in which if each cell is touched video plays. Each cell have image of the video cell.imageView.image. And on the image I have a button (UIButton) with play symbol. If I touch the play button the corresponding video should be played same like the when cell is touched. I have a selector for the play button. How can I relate the corresponding cell to the play button. Thank You.

    Read the article

  • UIButton setBackgroundImage consumes doesn't release memory?

    - by just_another_coder
    My UIButton has it's background image set like this: [myImageButton setBackgroundImage:[UIImage imageNamed:myImageName] forState:UIControlStateNormal]; myImageButton is a retained property of the class, and is setup with IB. No where else is it accessed in the app. myImageName is simply an NSString with a filename like @"myImage_number_1.png" I am loading large images, 1024 x 1024 in size. When the view is shown, it changes the image with the above statement, then available memory decreases. After I see the view about 7-9 different times, the app crashes with a memory warning. I thought the method would free up the loaded image. The view itself is only instantiated and allocated one time, so it's not in the retain/release cycle if the view controller. Is there something about this setBackgroundImage I don't know that causes it to not release memory?

    Read the article

  • UIButton At Run Time

    - by rami
    I want to create UIButton At Run Time. I Have main view in which I have Table View when I select Row it Open Sub View with Toolbar and in that I Click on Add Button on tool Bar it opens the another view in which I add My value(like name)now when I press save Button It goes back to the sub View with Toolbar and it create button with name which I save and add it in sub view But problem is when I do it again all things done well But The Button Which created previous is not seen in sub view.It display only button with name Which I save Last.

    Read the article

  • App shuts down when pushing UIbutton!

    - by maralbjo
    For reasons unknown my app shuts down upon pressing a UIButton in the simulator. I have dynamically added my UIView, if that is of relevance. No tracelog or debug information just a rush exit... This is the simple code (.m-file): - (IBAction) testButtonPressed: (id) sender{ NSLog (@"Testbutton pressed."); } From the header file: - (IBAction) testButtonPressed: (id) sender; Pretty basic stuff, but for some reason the app terminates. Help!

    Read the article

  • UIButton overlapping problem in the UIView?

    - by sai
    im trying to create buttons as ahierarchy, first some buttons are displayed if i click any of the buttons it will navigate to the next viewcontroller displaying some more buttons. But here my problem is butons are overlapped with one another . means the buttons that should not be displayed are also comming along with those should be . my code is for(.................) { butt = [[UIButton alloc] initWithFrame:CGRectMake(...)]; image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[arr objectAtIndex:i]]]]; imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; [butt setBackgroundImage:imageView.image forState:UIControlStateNormal]; [butt setTag:i]; [butt addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside]; [containerView addSubview:butt]; [butt release]; x+=butt.frame.size.width+2*hgap; i+=1; if (i==count+1) //[arr count] { printf("\nIN BREAK BUTTON\n"); break; } } y=y+(butt.frame.size.height+2*vgap); } Thankyou for the solution.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >