Creating a “loading…” view using iPhone SDK

后端 未结 7 1578
情歌与酒
情歌与酒 2021-02-01 08:57

How to create that black/gray modal popup kind of view that many apps use, when some long pending operation is in progress?

Like when using location based services, load

7条回答
  •  礼貌的吻别
    2021-02-01 09:02

    In XIB file, place UIView and UIActivityIndicatorView. Set ActivityIndicatorView Property SetAnimated to Yes.

    @property (retain, nonatomic) IBOutlet UIView* m_LoadingView;

    While Starting long operations, Add the LoadingView to the view

    m_LoadingView.layer.cornerRadius = 10;
    m_LoadingView.center = self.view.center;
    [self.view addSubview:m_LoadingView];
    

    After completing the process, Remove LoadingView from super view. [m_LoadingView removeFromSuperView];

提交回复
热议问题