카테고리 없음

[iOS] iOS는 navigationItem 제목에 연결되는 활동 표시기와 텍스트를 표시합니까?

행복을전해요 2021. 2. 5. 16:01

아래에서 시도하십시오 ...

// first create main view
UIView *mainView = [[UIView alloc] initWithFrame:.....

// now lets create label that you need to display
UILabel *titleLabel  = [[UILabel alloc] initWithFrame:.....
titleLabel.text = @"Title here";
[mainView addSubview:titleLabel];

// now create indicator
UIActivityIndicatorView *indicator = initWithFrame:.....
[mainView addSubview:indicator];


// now add mainView to titleView
self.navigationItem.titleView = mainView;


출처
https://stackoverflow.com/questions/22050134