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 8668483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:13:28+00:00 2026-06-12T18:13:28+00:00

In my iOS app when a button is pressed an event is initiated and

  • 0

In my iOS app when a button is pressed an event is initiated and at the bottom of the screen appears a status message informing the user about a successful or failed operation.

The status message appear and disappear with the following code.

this one show the message

- (void) showMessage:(NSString*)text
{
        CGRect frame = [[self view] frame];

        if(statusView == nil)
        {
            messageViewWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, frame.size.height-29,
                                                       frame.size.width, 0)];


            statusView = [[StatusMessageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 0)
                                                             Text:text
                                                 andShowIndicator:NO];
            [messageViewWindow addSubview:statusView];
            [messageViewWindow makeKeyAndVisible];
        }

        UILabel *label = [statusView getTextLabel]; 
        UIImageView *imageView = [statusView getBackImageView];

        CGSize stringSize = [text sizeWithFont:[Constants getLabelFont]];
        int xCoordinate = (messageViewWindow.frame.size.width - stringSize.width)/2;

        [UIView beginAnimations:nil context:nil];
        messageViewWindow.frame = CGRectMake(0, frame.size.height-59, frame.size.width, 30);
        statusView.frame = CGRectMake(0, 0, frame.size.width, 30);
        label.frame = CGRectMake(xCoordinate,5,stringSize.width,20);
        imageView.frame = CGRectMake(0, 0, frame.size.width, 30);
        [UIView commitAnimations];  

        [NSTimer scheduledTimerWithTimeInterval:2.0f target:self selector:@selector(hideMessage) userInfo:nil repeats:NO];

}

and this one hides the message

- (void) hideMessage
{
    UILabel *label = [statusView getTextLabel]; 
    UIImageView *imageView = [statusView getBackImageView];

    CGRect labelFrame = label.frame;

    [UIView beginAnimations:nil context:nil];
    messageViewWindow.frame = CGRectMake(0, [UIScreen mainScreen].applicationFrame.size.height-29, [UIScreen mainScreen].applicationFrame.size.width, 0);
    statusView.frame = CGRectMake(0, 0, [UIScreen mainScreen].applicationFrame.size.width, 0);  
    label.frame = CGRectMake(labelFrame.origin.x, 0, labelFrame.origin.y, 0);
    imageView.frame = CGRectMake(0, 0, [UIScreen mainScreen].applicationFrame.size.width, 0);
    [UIView commitAnimations];
}

strange thing is that the message is shown and after two seconds dissapears, however the main window lost functionality, like the copy and paste ability.

Do you see something wrong in my methods? Is there any certain way, calling the “animations” code?

  • 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-12T18:13:29+00:00Added an answer on June 12, 2026 at 6:13 pm

    Since you are writing [messageViewWindow makeKeyAndVisible];, you have to write [self.view.window makeKeyAndVisible] in hideMessage to let the self.view.window handle all the userinteraction again.

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

Sidebar

Related Questions

In iOS 4, when a user presses the Home button, the running app will
I want to create an iOS app that contains a uiimageview and a button
The iOS app Display Recorder claims to be able to record the screen of
I need to generate a grid of buttons for an iOS app. Each button
In my iOS app, I have a simple feature that lets the user rate
In my iOS app I have a screen with a bunch of icons that
In my iOS app's Settings screen, there is one setting which is quite fundamental.
When a foreground app gets backgrounded (e.g. Home button gets pressed), how can I
My iOS app doesn't run in background. When home button is hit the app
So I'm trying to implement a custom button in my iOS app to replace

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.