Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6962733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:41:55+00:00 2026-05-27T15:41:55+00:00

I need to create the UI component shown in the image below, and also

  • 0

I need to create the UI component shown in the image below, and also i need to know;

  1. What is it called? (The grey colored box)
  2. How do i add an image or any other UI component to it?
  3. Is there any sample code or tutorial available creating this?

The image

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:41:56+00:00Added an answer on May 27, 2026 at 3:41 pm

    MBProgressHud have no progress bar. I’ve created one by using PDColoredProgressView and Three20

    It looks like this:
    enter image description here

    and goes that way:

    .h file

    #import <UIKit/UIKit.h>
    #import "PDColoredProgressView.h"
    
    @interface SVProgressHudView : UIView<PDColoredProgressViewDelegate>{
        UIView*                 bgView;
        UILabel*                _titleLabel;
        PDColoredProgressView*  _progress;
        UILabel*                _percentLabel;
        UILabel*                _subtitleLabel;
        NSUInteger              _numOfSteps;
        NSUInteger              _currentStep;
        CGFloat                 _currentStepProgress;
        CGFloat                 _oneStepPart;
        CGFloat                 _extraStepPart;
        BOOL                    _removeFromSuperViewOnHide;
        BOOL                    _extraStep;
        UIButton*               _closeButton;
    }
    
    @property (nonatomic, assign)BOOL   removeFromSuperViewOnHide;
    
    +(SVProgressHudView *)hudAddedTo:(UIView *)view withTitle:(NSString*)title numberOfSteps:(NSUInteger)numberOfSteps extraStep:(BOOL)exrta;
    +(BOOL)isThereHudAddedToView:(UIView*)view;
    
    -(id)initWithFrame:(CGRect)frame title:(NSString*)title numberOfSteps:(NSUInteger)numberOfSteps extraStep:(BOOL)exrta;
    
    -(void)show:(BOOL)animated;
    -(void)hide:(BOOL)animated;
    -(void)setCurrentStepProgress:(CGFloat)currentProgress animated:(BOOL)animated;
    -(void)setCurrentStep:(NSUInteger)currentStep animated:(BOOL)animated;
    -(void)setExtraStepProgress:(CGFloat)progress animated:(BOOL)animated;
    
    -(void)setSuccessSubtitle:(NSString*)subtitle;
    
    -(void)setCloseButtonTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;
    
    @end
    

    .m file:

    #import "SVProgressHudView.h"
    #import <QuartzCore/QuartzCore.h>
    #import <Three20/Three20.h>
    #import "Three20UI/UIViewAdditions.h"
    #import "Globals.h"
    #import "SVGradientButton.h"
    
    #define kMinimumWidth           100
    #define kMinimumHeight          100
    
    #define kHorizontalMargin       20
    #define kVerticalMargin         20
    #define kLittleVerticalMargin   7
    #define kCornerRadius           10
    
    #define kOpacity                0.85
    
    static UIFont* regularSubtextFont;
    static UIFont* successSubtextFont;
    
    @interface SVProgressHudView(Private)
    
    -(void)done;
    
    @end
    
    @implementation SVProgressHudView
    
    @synthesize 
    removeFromSuperViewOnHide = _removeFromSuperViewOnHide;
    
    +(void)initialize{
        regularSubtextFont = [[UIFont systemFontOfSize:[UIFont systemFontSize]+3]retain];
        successSubtextFont = [[UIFont systemFontOfSize:[UIFont systemFontSize]+3]retain];
    }
    
    - (id)initWithFrame:(CGRect)frame{
        CGFloat minimumWidth = kMinimumWidth+kHorizontalMargin*2;
        CGFloat minimumHeight = kMinimumHeight + kVerticalMargin*2;
        //to ensure we can place it inside that frame
        if(frame.size.width>=minimumWidth && frame.size.height >=minimumHeight){
            self = [super initWithFrame:frame];
            if (self) {
                CGFloat bgWidth = frame.size.width - kHorizontalMargin*2;
                bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, bgWidth, kMinimumHeight)];
                bgView.backgroundColor = [[UIColor blackColor]colorWithAlphaComponent:kOpacity];
                bgView.clipsToBounds = YES;
                bgView.center = CGPointMake(self.width/2.0, self.height/2.0);
                bgView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
                bgView.layer.cornerRadius = 10.0;
                bgView.layer.masksToBounds = YES;
                [self addSubview:bgView];
    
                UIImage* closeImage = [UIImage imageNamed:@"xButton.png"];
                _closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
                _closeButton.frame = CGRectMake(0, 0, closeImage.size.width*1.5, closeImage.size.height*1.5);
                [_closeButton setBackgroundImage:closeImage forState:UIControlStateNormal];
                [_closeButton addTarget:self action:@selector(closeFired) forControlEvents:UIControlEventTouchUpInside];
                _closeButton.right = bgView.right +_closeButton.width/3;
                [self addSubview:_closeButton];
    
                _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kHorizontalMargin, kVerticalMargin, bgWidth-kHorizontalMargin*2, 20)];
                _titleLabel.textColor = [UIColor whiteColor];
                _titleLabel.textAlignment = UITextAlignmentCenter;
                _titleLabel.backgroundColor = [UIColor clearColor];
                [bgView addSubview:_titleLabel];
    
                _progress = [[PDColoredProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
                _progress.delegate = self;
                [_progress setBackgroundColor:[UIColor clearColor]];
                [_progress setTintColor:[UIColor colorWithWhite:0.5 alpha:1.0]];//[Globals defaultTintColorForNavBar]];
                [bgView addSubview:_progress];
                [_progress sizeToFit];
                _progress.top = _titleLabel.bottom+kVerticalMargin;
                _progress.width = bgWidth-kHorizontalMargin*2-kCornerRadius*2;
                _progress.left = kHorizontalMargin+kCornerRadius;
                _progress.progress = 0.0;
    
                _percentLabel = [[UILabel alloc]initWithFrame:CGRectMake(_progress.left, _progress.bottom+kLittleVerticalMargin, _progress.width/2, 20)];
                _percentLabel.textColor = [UIColor whiteColor];
                _percentLabel.textAlignment = UITextAlignmentLeft;
                _percentLabel.backgroundColor = [UIColor clearColor];
                _percentLabel.font = regularSubtextFont;
                [bgView addSubview:_percentLabel];
    
                _subtitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(_percentLabel.right, _percentLabel.top, _percentLabel.width, 20)];
                _subtitleLabel.textColor = [UIColor whiteColor];
                _subtitleLabel.textAlignment = UITextAlignmentRight;
                _subtitleLabel.backgroundColor = [UIColor clearColor];
                _subtitleLabel.font = regularSubtextFont;
                [bgView addSubview:_subtitleLabel];
    
                bgView.height = _subtitleLabel.bottom+kVerticalMargin;
                bgView.center = self.center;
    
                _closeButton.top = bgView.top - _closeButton.height/3;
    
                _extraStep = NO;            
            }
        }
        return self;
    }
    
    -(id)initWithFrame:(CGRect)frame title:(NSString*)title numberOfSteps:(NSUInteger)numberOfSteps extraStep:(BOOL)exrta{
        self = [self initWithFrame:frame];
        if(self){
            _titleLabel.text = title;
            _numOfSteps = numberOfSteps;
            _extraStep = exrta;
            if(_extraStep){
                CGFloat stepPart = 1.0/numberOfSteps;
                _extraStepPart = stepPart/10;
                _oneStepPart = (1.0-_extraStepPart)/numberOfSteps;
            }else{
                _oneStepPart = 1.0/numberOfSteps;
            }
            [self setCurrentStep:0 animated:NO];
        }
        return self;
    }
    
    -(void)dealloc{
        TT_RELEASE_SAFELY(_titleLabel);
        TT_RELEASE_SAFELY(_subtitleLabel);
        TT_RELEASE_SAFELY(_percentLabel);
        TT_RELEASE_SAFELY(_progress);
        TT_RELEASE_SAFELY(bgView);
        [super dealloc];
    }
    
    #pragma mark - Showing and Hiding
    
    - (void)show:(BOOL)animated {
        self.alpha = 0.0;
        // Fade in
        if (animated) {
            [UIView animateWithDuration:0.3 
                             animations:^{
                                 self.alpha = 1.0;
                             }];
        }else {
            self.alpha = 1.0;
        }
    }
    
    - (void)hide:(BOOL)animated {
        if (animated) {
            [UIView animateWithDuration:0.3
                             animations:^{
                                 self.alpha = 0.2;
                             } 
                             completion:^(BOOL finished) {
                                 [self done];
                             }];
        }
        else {
            [self done];
        }
    }
    
    #pragma mark - Private Methods
    
    - (void)done {
        self.alpha = 0.0;
        if (_removeFromSuperViewOnHide) {
            [self removeFromSuperview];
        }
    }
    
    #pragma mark - Public Methods
    
    + (BOOL)isThereHudAddedToView:(UIView*)view{
        for (UIView *v in [view subviews]) {
            if ([v isKindOfClass:[SVProgressHudView class]]) {
                return YES;
            }
        }
        return NO;
    }
    
    + (SVProgressHudView *)hudAddedTo:(UIView *)view withTitle:(NSString*)title numberOfSteps:(NSUInteger)numberOfSteps extraStep:(BOOL)exrta{
        SVProgressHudView *hud = [[SVProgressHudView alloc] initWithFrame:view.bounds title:title numberOfSteps:numberOfSteps extraStep:exrta];
        hud.alpha = 0.0;
        [view addSubview:hud];
        return [hud autorelease];
    }
    
    -(void)setCurrentStepProgress:(CGFloat)currentStepProgress animated:(BOOL)animated{
        if(currentStepProgress < 0.0){
            currentStepProgress = 0.0;
        }
        if(currentStepProgress > 1.0){
            currentStepProgress = 1.0;
        }
        CGFloat currentProgress = _oneStepPart*_currentStep;
        currentProgress += _oneStepPart*currentStepProgress;
        [_progress setProgress:currentProgress animated:animated];
    }
    
    -(void)setCurrentStep:(NSUInteger)currentStep animated:(BOOL)animated{
        if(currentStep > _numOfSteps){
            currentStep = _numOfSteps;
        }
        _currentStep = currentStep;
        _subtitleLabel.text = [NSString stringWithFormat:@"%d/%d",currentStep+1,_numOfSteps];
        _subtitleLabel.font = regularSubtextFont;
        [self setCurrentStepProgress:0.0 animated:animated];
    }
    
    -(void)setExtraStepProgress:(CGFloat)progress animated:(BOOL)animated{
        if(progress < 0.0){
            progress = 0.0;
        }
        if(progress > 1.0){
            progress = 1.0;
        }
        if(progress == 1.0){
            //hide the close button
            _closeButton.hidden = YES;
        }
        CGFloat currentProgress = _oneStepPart*_numOfSteps;
        currentProgress += _extraStepPart*progress;
        [_progress setProgress:currentProgress animated:animated];
    }
    
    -(void)progressUpdated:(PDColoredProgressView *)progressView toValue:(CGFloat)value{
        _percentLabel.text = [NSString stringWithFormat:@"%d%%",(int)(value*100)];
    }
    
    -(void)setSuccessSubtitle:(NSString *)subtitle{
        [_progress setProgress:1.0 animated:YES];
        _subtitleLabel.text = subtitle;
        _subtitleLabel.font = successSubtextFont;
    }
    
    -(void)closeFired{
        [_progress cancelAnimations];
    }
    
    -(void)setCloseButtonTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents{
        [_closeButton addTarget:target action:action forControlEvents:controlEvents];
    }
    
    @end
    

    It’s far from being perfect as it was created for specific purpose, but it’s doing the job.
    Hope it helps.
    Happy coding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a custom GUI Component about same like shown in the
I need to create a component as shown in the figure - a tree
I am working on one component where I need to scale and rotate image.
I need to dynamically create a Video object in ActionScript 2 and add it
I need help with this question. I'm using the camel-http component as shown here
I need to create a custom Component with JSF 2.0 (not composite component), that
I have a component that create dynamically html table. According to my need, I
I've got a custom component that I need to use if I create a
I need to create a custom component in Flex 4.5 by extending the spark
I need to create a panel which should be invisible but the components inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.