【发布时间】:2012-03-12 02:52:31
【问题描述】:
我在 uialertview 中有三个按钮和一个 textview,并尝试通过在 uialertview 的消息属性中添加“\n”来向下移动按钮。但这是行不通的。当达到一行的限制时,字符串将变为“...”。 textview 总是覆盖我的按钮。你有什么建议吗?抱歉,我无权发布图片。
- (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 )];
}
【问题讨论】:
标签: ios button message uialertview