search

Home  >  Q&A  >  body text

ios - 如何在连接网络时弹出活动指示器?

我封装了一个类,里面有个方法用于处理网络连接,我想在这个方法里加入活动指示器,
在连接网络前让activityindicator startanimating,而不必在每个视图控制器那里加入
活动指示器,请问该怎么做?

迷茫迷茫2786 days ago701

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 14:50:07

    Where do you want to add it? ?
    If you want to call the system: [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
    This is the chrysanthemum on the left side of the battery bar.
    If you want it to be in the middle of the screen, just add it to keyWindow.
    There is an open source network request indicator, click here HUD

    reply
    0
  • Cancelreply