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
  • 1 View
  • 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

Related Questions

Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: This question is more about language engineering than C++ itself. I used C++
EDIT: upgraded this question to MVC 2.0 With asp.net MVC 2.0 is there an
Edit: This is technically a 2 part question. I've chosen the best answer that
EDIT: had to retag this, because, it's rather a Sweave / R question since
Edit: From another question I provided an answer that has links to a lot
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
Edit: Just wanted to make the question I have more clear. I pretty much

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.