Problem in changing size of uialertview?

To achieve what you want, in your code, after.

To achieve what you want, in your code, after: find show; add: find. Frame = CGRectMake(0,0,300,200); It's not pretty though, I suggest you use ActionSheets.

Here I want to change the width of the alert view how can I change that ,i am able to change the height but don't know how to change width. – mrugen Oct 20 '10 at 7:28 Well my answer still applies you can change width after the call to find show, and the result is still ugly and you shoud still use actionsheets – ahmet emrah Oct 20 '10 at 8:15 this just changes the uiwindow for me (ie - the textfield 'message' inside doesn't resize) – roocell Oct 19 at 21:23.

UIAlertView *alert = UIAlertView alloc initWithTitle:@"Confirmation" message:@" Submit the answer " delegate:self cancelButtonTitle:@"NO" otherButtonTitles:@"YES", nil; alert show; alert release; UILabel *theTitle = alert valueForKey:@"_titleLabel"; theTitle setTextColor:UIColor blackColor; UILabel *theBody = alert valueForKey:@"_bodyTextLabel"; theBody setTextColor:UIColor blackColor; UIImage *theImage = UIImage imageNamed:@"blue-white-abstract-background. Jpg"; theImage = theImage stretchableImageWithLeftCapWidth:10 topCapHeight:10; CGSize theSize = alert frame. Size; UIGraphicsBeginImageContext(theSize); theImage drawInRect:CGRectMake(0, 0, theSize.

Width, theSize. Height); theImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); //alert layer setContents:theImage CGImage; alert layer setContents:UIColor clearColor; This code does a lot of things to alertview and modify it to increase the size of the alert view.

This does the job pretty well, and does not look weird when the alert appear (ahmet emrah solution has a pretty bad side effect). CGAffineTransform myTransform = CGAffineTransformMakeScale(1.0, 0.5f); alert setTransform:myTransform.

You can subclass the UIAlertView. I have done something like this, change it for your need. Header file, #import /* An alert view with a textfield to input text.

*/ @interface AlertPrompt : UIAlertView { UITextField *textField; } @property (nonatomic, retain) UITextField *textField; @property (readonly) NSString *enteredText; - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle okButtonTitle:(NSString *)okButtonTitle; @end Source code, #import "AlertPrompt. H" @implementation AlertPrompt static const float kTextFieldHeight = 25.0; static const float kTextFieldWidth = 100.0; @synthesize textField; @synthesize enteredText; - (void) drawRect:(CGRect)rect { super drawRect:rect; CGRect labelFrame; NSArray *views = self subviews; for (UIView *view in views){ if (view isKindOfClass:UILabel class) { labelFrame = view. Frame; } else { view.

Frame = CGRectMake(view.frame.origin. X, view.frame.origin. Y + kTextFieldHeight , view.frame.size.

Width, view.frame.size. Height); } } CGRect myFrame = self. Frame; self.textField.

Frame = CGRectMake(95, labelFrame.origin. Y+labelFrame.size. Height + 5.0, kTextFieldWidth, kTextFieldHeight); self.

Frame = CGRectMake(myFrame.origin. X, myFrame.origin. Y, myFrame.size.

Width, myFrame.size. Height + kTextFieldHeight); } - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle okButtonTitle:(NSString *)okayButtonTitle { if (self = super initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:okayButtonTitle, nil) { // add the text field here, so that customizable from outside. But set the frame in drawRect.Self.

TextField = UITextField alloc init; self. TextField setBackgroundColor:UIColor whiteColor; self addSubview: self. TextField; // CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, 20.0); // self setTransform:translate; } return self; } - (void)show { textField becomeFirstResponder; super show; } - (NSString *)enteredText { return textField.

Text; } - (void)dealloc { textField release; super dealloc; } @end.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions