UIAlertView 的自定义

继承UIAlertView  然后改写layoutSubviews方法

- (void)layoutSubviews{
    CGRect rect = self.bounds;
    rect.size.height = 300;
    self.bounds = rect;
    [self setBackgroundColor:[UIColor greenColor]];
    //重新设置确定,返回按钮的位置。
    for(UIView *subview in [self subviews]) {
        if([subview isKindOfClass:[UIControl class]] ) {
            CGRect frame = subview.frame;
            frame.origin.y = 180;
            subview.frame = frame;
        }
    }
}

posted @ 2013-08-23 16:55  _安静ゝ  阅读(281)  评论(0)    收藏  举报