Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8211471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:26:14+00:00 2026-06-07T10:26:14+00:00

How do I create a uibutton, which will show a uilabel of some text

  • 0

How do I create a uibutton, which will show a uilabel of some text briefly something like a speech bubble that will appear and then disappear. The problem is the speech bubble will be a view lying halfway outside the button frame.

thanks for help on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:26:16+00:00Added an answer on June 7, 2026 at 10:26 am

    Add a UIButton in the .xib file and give some name.

    Add the folowing method in your code.
    - (IBAction)bubbleButn:(UIButton *)btn

    Then right click on the button and see the “Touch Up Inside” part in the menu. Then you can click and drag the right most circle to the files owner in the “Placeholders” section of the Xocde. Then you can see the method name comes in a menu. You can select our method from there.

    Next we are going to implement our code.

    At first you must declare a UILabel in the .h file.

    #import <UIKit/UIKit.h>
    
    @interface ViewController : UIViewController {
        UILabel *bubbleLabel_;
    }
    
    @end
    

    and then in the .m file implement the button action and label settings.

    - (IBAction)bubbleButn:(UIButton *)btn {
        float half = btn.frame.size.width/2;
        float yVal = btn.frame.size.height/2;
        if(bubbleLabel_) {
        /* 
         If you are using 'arc' no need of this statement
         add this in the dealloc method also.
         */
        [bubbleLabel_ release];
        bubbleLabel_ = nil;
    }
        bubbleLabel_ = [[UILabel alloc] initWithFrame:CGRectMake(btn.frame.origin.x+half, btn.frame.origin.y+yVal, 40, 50)];                        
        bubbleLabel_.text = @"Hi";
    
        [self.view addSubview:bubbleLabel_];
    
        [self performSelector:@selector(hideBubble) withObject:self afterDelay:3];
    
    }
    
    
    - (void) hideBubble {
        [bubbleLabel_ removeFromSuperview];
    }
    

    The label named “Hi” will be there for 3 seconds.

    Go on…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to create a UIButton with an image that has no borders (a
I'm trying to create a custom UIButton that should look like a UIButtonTypeRoundedRect. In
i would like to create a UIButton it will zoom in when mouse over
I would like to create a UIButton which uses a stretchable image as Background
I have main UIScrollView with lots off buttons which i create like this: UIButton
I'm trying to create a UIButton programmatically. I have a button called addCash (which
I have a UIButton that I create in my sub class ViewController, and add
In iOS5 using storyboard feature I want to create a custom container which will
I want to have a UIButton in each UITableViewCell that will allow me to
I want to create some UIbutton dynamically. And display the tag number. So I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.