开发者

Hide ActivityIndicator and display Title in NavigationBar

开发者 https://www.devze.com 2022-12-21 04:29 出处:网络
i display an activityindicator like CGRect frame = CGRectMake(0.0, 0.0, 25.0, 25.0); loading = [[UIActivityIndicatorView alloc] initWithFrame:frame];

i display an activityindicator like

    CGRect frame = CGRectMake(0.0, 0.0, 25.0, 25.0);
loading = [[UIActivityIndicatorView alloc] initWithFrame:frame];
[loading startAnimating];
[loading sizeToFit];
loading.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |
                            UIViewAutoresizingFlexibleRightMargin |
                            UIViewAutoresizingFlexibleTopMargin |
                            UIViewAutoresizingFl开发者_运维技巧exibleBottomMargin);

self.navigationItem.titleView = loading;

in my navigationbar on the top. And i call:

[loading stopAnimating];

to stop.

This works like it should, but after hiding the activity indicator i want to display a text (self.title = @"text";) and this is not working.

What do i miss? Thanks for your help!


Try setting the self.navigationItem.titleView to nil and then set the title.

0

精彩评论

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

关注公众号