0
我在uialertview中有三個按鈕和一個textview,並嘗試在uialertview的消息屬性中添加「\ n」按鈕。但這不起作用。當字符串達到一行的限制時,字符串將變爲「...」。 textview總是覆蓋我的按鈕。你有什麼建議嗎?對不起,我沒有權利發佈圖片。如何向下移動UIAlertView中的按鈕?
- (void)addMessage
{
self.addMessageAlertView = [[UIAlertView alloc] initWithTitle:@"Add Title"
message:@"\n\n\n\n function normal function normal function normal function normal function normal "
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK",@"Search", nil];
self.addMessageTextView = [[UITextView alloc] initWithFrame:CGRectMake(10.0, 75, 260.0, 25*2)];
[addMessageTextView setBackgroundColor:[UIColor whiteColor]];
addMessageTextView.font = [UIFont systemFontOfSize:20];
addMessageTextView.delegate=self;
addMessageTextView.layer.masksToBounds=YES;
addMessageTextView.layer.cornerRadius=10.0;
addMessageTextView.layer.borderWidth=0.0;
[addMessageAlertView addSubview:addMessageTextView];
[addMessageAlertView show];
[addMessageAlertView release];
[addMessageTextView release];
}
- (void)willPresentAlertView:(UIAlertView *)openURLAlert
{
[openURLAlert setFrame:CGRectMake(10, 60, 300, 300)];
[openURLAlert setBounds:CGRectMake(0, 10, 290, 290)];
}
謝謝,但我確實會改變UIAlertView中與(無效)willPresentAlertView框架。但問題是消息屬性中的「\ n」沒有功能。 – MuddySky 2012-03-12 03:53:56