开发者

Adding sub-view inside an Other subview

I want to add an activity Indicator View inside and Alert开发者_C百科 Box is it possible to add an subView inside Another subView?


Use below code :

  UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@" " message:@" " delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
        UIActivityIndicatorView *myActivityIndicatorView= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(100, 60, 40, 40)];
        myActivityIndicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
        [myAlert addSubview:myActivityIndicatorView];
        [myActivityIndicatorView startAnimating];
        [myAlert show];


yes it is possible...

[alertView addSubview:activityIndicator];


Technically, yes. Simply alloc and init both views, then call

[alertView addSubview:activityView];

However, if this passes Apple's inspection is doubtful, so you may not be able to publish to the AppStore.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜