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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:02:46+00:00 2026-05-11T01:02:46+00:00

[EDIT] Hmm. Perhaps this question should be titled what is the default user-input dialog

  • 0

[EDIT] Hmm. Perhaps this question should be titled ‘what is the default user-input dialog view called in CocoaTouch?’ I realize that I can create an entire view that is exactly what I want, and wrap it in a view controller and presentModalView — but I was sort of hoping that there was a standard, normal user-input ‘dialog’ view that came-with Cocoa-touch. ‘Enter your name’, ‘enter text to search’, etc., are VERY common things!

Anyway… here’s the question as I originally asked it:

This code:

UIAlertView* find = [[UIAlertView alloc] init]; [find setDelegate:self]; [find setTitle:@'Find'];  [find addButtonWithTitle:@'Cancel']; [find addButtonWithTitle:@'Find & Bring']; [find addButtonWithTitle:@'Find & Go']; [find addButtonWithTitle:@'Go To Next'];  [find addSubview:_findText];  CGRect frm = find.frame; int height = frm.size.height + _findText.frame.size.height + 100; // note how even 100 has no effect. [find setFrame:CGRectMake(frm.origin.x, frm.origin.y, frm.size.width, height)];  [find setNeedsLayout]; [find show]; [find release]; 

Produces this Alert view:

Find Alert http://www.publicplayground.com/IMGs/Misc/FindAlert.png

(I started with the code from this question by emi1Faber, and it works as advertised; however, as I state in my comment, the cancel button overlays the text field.)

How do I reshuffle everything to make the text field fit properly? [findAlert setNeedsLayout] doesn’t seem to do anything, even after I [findAlert setFrame:tallerFrame]. Hints?

Thanks!

  • 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. 2026-05-11T01:02:46+00:00Added an answer on May 11, 2026 at 1:02 am

    The simplest (and most proper way) to move the text view down is to add a message

    [find setMessage:@'\n']; 

    Also, the reason your frame isn’t taking effect is that -show sets the frame and creates the view hierarchy before starting the animation. You should also make the text view the first responder so the keyboard pops up.

    Full example:

    // Create Alert UIAlertView* av = [UIAlertView new]; av.title = @'Find'; // Add Buttons [av addButtonWithTitle:@'Cancel']; [av addButtonWithTitle:@'Find & Bring']; [av addButtonWithTitle:@'Find & Go']; [av addButtonWithTitle:@'Go to Next']; // Make Space for Text View av.message = @'\n'; // Have Alert View create its view heirarchy, set its frame and begin bounce animation [av show]; // Adjust the frame CGRect frame = av.frame; frame.origin.y -= 100.0f; av.frame = frame; // Add Text Field UITextField* text = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)]; text.borderStyle = UITextBorderStyleRoundedRect; [av addSubview:text]; [text becomeFirstResponder]; 

    Note: You can also modify the subviews of UIAlertView, but since Apple has already changed the UIAlertView layout once you should check their class descriptions and frames against known values before setting new ones. You can even get something like this:

    Preview
    (source: booleanmagic.com)

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

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here you have a pure XAML-example: http://blogs.msdn.com/text/archive/2006/06/20/592777.aspx The key part… May 12, 2026 at 1:11 am
  • Editorial Team
    Editorial Team added an answer You can't refer to it because it is inside an… May 12, 2026 at 1:11 am
  • Editorial Team
    Editorial Team added an answer Solution: There was a general css setup for the image… May 12, 2026 at 1:11 am

Related Questions

Been doing Java for number of years so haven't been tracking C++. Has finally
I'm trying to do a simple rotation in OpenGL but must be missing the
I wrote a small internal web app using (a subset of) pylons . As
I am really new to Haskell (Actually I saw Real World Haskell from O'Reilly

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.