Reputation: 225
In my cocos2d game i can't change size of uialertview, i have changed statusbarorientation to landscape, and now want to init alertview with frame, and initwithframe method does not affect the size of alertview, every time the size of alert is the same, is there any way to change it ?
Upvotes: 2
Views: 14581
Reputation: 1777
its not possible to customized UIAlertView cause its view hierarchy is private.
its clearly mentioned here UIAlertView_Class
You can go for UIView and create it similar to UIAlertView.
Upvotes: 3
Reputation: 62519
Here is what i did. Create your uialertview in your controller. then override the following class within your controller (after setting the uialertview delegate ... ie. myalertview.delegate=viewcontroller)
- (void)willPresentAlertView:(UIAlertView *)alertView {
[alertView setFrame:CGRectMake(1, 20, 2700, 400)];
}
the frame size should change after this.
Upvotes: 9
Reputation: 11
If a alert view has any title or messages text input within its view, then just append as many new line '\n' at the end of text it automatically scale its size.
Its just a mock, but stil doable to retain the alertbox usage in you application.
Upvotes: 1
Reputation: 3803
Just create UIView which looks like UIAlertView. That will solve all the problem you mentioned.
Upvotes: 1