Only a few lines of code to implement an Easy-to-use status bar indicator _ios

Source: Internet
Author: User

We often run into status indicators when using microblogs, and wonder what it does? This article is a few lines of code to achieve the Easy-to-use status bar indicator.

Microblog number Reminder box for Weibo project

/** reminder of the latest microblog number/
-(void) Shownewstatuscount: (Nsinteger) Count
{
  if (count) {[
   Xzmstatusbarhud Sharedxzmstatusbarhud] shownormal:[nsstring stringwithformat:@ "has%ld new Weibo", Count] position:64 animadelay:0 configuration:^{
 
     /** settings need to be added to which view/
     [Xzmstatusbarhud sharedxzmstatusbarhud].formview = Self.view;
   }];
  else {[
 
    xzmstatusbarhud Sharedxzmstatusbarhud] shownormal:@ "No new microblogging data" position:64 animadelay:0 configuration:^{
 
      /** settings need to be added to which view/
      [Xzmstatusbarhud sharedxzmstatusbarhud].formview = Self.view;
    }];
  }
}

Load the background color of the reminder box successfully set

[[Xzmstatusbarhud Sharedxzmstatusbarhud] showsuccess:@ ' Load succeeded ' position:0 animadelay:0 configuration:^ () {

/** Set transparency * *
[Xzmstatusbarhud sharedxzmstatusbarhud].statusalpha = 0.7;

/** set the background color of the reminder box * *
[Xzmstatusbarhud sharedxzmstatusbarhud].statuscolor = [Uicolor bluecolor];

Position: The position of the reminder section of the status bar can be set the default value is 0

animadelay: You can set the duration of the animation, 0 represents the default value: 1.0

Loading and setting the background color of the reminder box

[[Xzmstatusbarhud Sharedxzmstatusbarhud] showloading:@ "in load ..." position:0 animadelay:0 configuration:^ () {

    /** sets the background color of the reminder box */
    [Xzmstatusbarhud sharedxzmstatusbarhud].statuscolor = [Uicolor redcolor];
  }];

Position: The position of the reminder section of the status bar can be set the default value is 0

animadelay: You can set the duration of the animation, 0 represents the default value: 1.0 

Implementation of the effect is not very interesting, the above is to implement the status indicator of the corresponding code, I hope to help you learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.