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 8935927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:06:03+00:00 2026-06-15T10:06:03+00:00

The way I’ve been doing it for a few years is to simply create

  • 0

The way I’ve been doing it for a few years is to simply create two toolbars, and set one or the other to hidden while the UIWebView loads. All of my toolbars and barbutton items are created in IB. I would like to make my implementation smaller if I can without this sort of “hack” I appreciate any help offered.

Here is the code I’m using:

#import "Web.h"

@interface  Web()

@property (nonatomic, strong) IBOutlet UIWebView *webView;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *refreshButton;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *stopButton;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *backButtonRefreshToolbar;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *forwardButtonRefreshToolbar;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *backButtonStopToolbar;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *forwardButtonStopToolbar;
@property (nonatomic, strong) IBOutlet UIToolbar *toolbarStop;
@property (nonatomic, strong) IBOutlet UIToolbar *toolbarRefresh;

@end

@implementation Web

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    self.toolbarStop.hidden = NO;
    self.toolbarRefresh.hidden = YES;
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    self.toolbarStop.hidden = YES;
    self.toolbarRefresh.hidden = NO;
    [self actualizeButtons];
}

- (void)actualizeButtons
{
    self.backButtonRefreshToolbar.enabled = [self.webView canGoBack];
    self.forwardButtonRefreshToolbar.enabled = [self.webView canGoForward];
    self.backButtonStopToolbar.enabled = [self.webView canGoBack];
    self.forwardButtonStopToolbar.enabled = [self.webView canGoForward];
}
  • 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-06-15T10:06:04+00:00Added an answer on June 15, 2026 at 10:06 am

    This is what I came up with based on the above help:

    @property (nonatomic, strong) IBOutlet UIToolbar *webToolbar;
    @property (nonatomic, strong) UIBarButtonItem *backButton;
    @property (nonatomic, strong) UIBarButtonItem *forwardButton;
    @property (nonatomic, strong) UIBarButtonItem *refreshButton;
    @property (nonatomic, strong) UIBarButtonItem *stopButton;
    @property (nonatomic, strong) UIBarButtonItem *flexibleItem;
    
    - (void)toolbarButtons
    {
        self.backButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"UIButtonBarArrowLeft.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(goBack)];
    
        self.forwardButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"UIButtonBarArrowRight.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(goForward)];
    
        self.backButton.enabled = [self.webView canGoBack];
        self.forwardButton.enabled = [self.webView canGoForward];
    
        self.flexibleItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
                                                                      target:nil
                                                                      action:nil];
    
    
        self.refreshButton = [[UIBarButtonItem alloc]
                          initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
                          target:self action:@selector(refreshWebView)];
    
        self.refreshButton.style = UIBarButtonItemStyleBordered;
    
        self.stopButton = [[UIBarButtonItem alloc]
                          initWithBarButtonSystemItem:UIBarButtonSystemItemStop
                          target:self action:@selector(stop)];
    
        self.stopButton.style = UIBarButtonItemStyleBordered;
    
        if(self.webView.loading)
        {
            NSArray *items = [NSArray arrayWithObjects: self.backButton, self.forwardButton, self.flexibleItem, self.stopButton, nil];
            [self.webToolbar setItems:items animated:NO];
        }
        else
        {
            NSArray *items = [NSArray arrayWithObjects: self.backButton, self.forwardButton, self.flexibleItem, self.refreshButton, nil];
            [self.webToolbar setItems:items animated:NO];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One way or another I need to link groupID (and one other integer) to
Current way: while(read(pipe, input, sizeof(input))>0); Is there a better one with seeking?
Way way back (think 20+ years) I encountered a Gomoku game source code in
any way to set custom cursor from image for a jscrollpane in a jsplitpane
The way I have my page set up right now is pretty solid. I
The way I understand it one of the things special about Objective C is
zf2 way to set up a navigation bar there is a sample to do
One way: javascript_tag do == var all_product_ids = #{existing_ids.to_json}; == var products_json = #{@filter.data.to_json};
Which way do you prefer to create your forms in MVC? <% Html.Form() {
Typical way of creating a CSV string (pseudocode): Create a CSV container object (like

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.