开发者

Adding sub-view inside an Other subview

开发者 https://www.devze.com 2023-03-14 04:04 出处:网络
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 :

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

精彩评论

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