Search Results

Search found 7 results on 1 pages for 'toolbaritems'.

Page 1/1 | 1 

  • How do I remove a button from a view controller's toolbar on the iPhone?

    - by Tony
    I have code that works great for adding a button to the toolbar: NSArray* toolbarItems = [NSArray arrayWithObjects:flexibleSpace,shuffleBarItem,flexibleSpace,nil]; self.toolbarItems = toolbarItems; However, I also want to be able to remove toolbar items. When I use the below method, my application crashes: NSArray* toolbarItems = [NSArray arrayWithObjects:flexibleSpace,nil]; self.toolbarItems = toolbarItems; Does anyone know how I can dynamically alter the toolbar on the iPhone? Thanks!

    Read the article

  • How can I create a custom UIToolbar like component in a UITableViewController?

    - by Tony
    I have a UITableViewController. I want a "toolbar-ish" component at the bottom. I started by using a background image and a button. In interface builder, I added them to the bottom of the iPhone screen. The problem I ran into was that the background image and button scrolled with the table. I obviously need this fixed at the bottom. Not finding too much direction online, I decided to customize a UIToolbar to look how I want since the position is fixed by default. In my initWithNibName for my UITableViewController, I have: UIImage *shuffleButtonImage = [UIImage imageNamed:@"shuffle_button.png"]; NSArray* toolbarItems = [NSArray arrayWithObjects: [[UIBarButtonItem alloc] initWithImage:shuffleButtonImage style:UIBarButtonItemStylePlain target:self action:@selector(push:)], nil]; [toolbarItems makeObjectsPerformSelector:@selector(release)]; self.toolbarItems = toolbarItems; The problem I am running into now is that the "shuffleButtonImage" is not showing up properly. The shape of the button shows up fine but it is colored white and therefore does not look like the image. Does anyone know why a "white image" would be showing instead of the actual image? Also does it sound like a good idea to customize a UIToolbar or is there a simple way to ensure a fixed position "toolbar-ish" component. To reiterate - my "toolbar-ish" component only needs to be one button at the button of my UITableView. The single button has a gradient color background that I create with an image.

    Read the article

  • Extjs Tooltips, IFrames and IE => Problems

    - by Chau
    I have an application using OpenLayers, Extjs and GeoExt. My application runs fine, but I need it to be placed inside an IFrame in another page. When doing this, my toolbar becomes responseless in Internet Explorer. The cause is Ext.QuickTips.init();. Comment out this line and everything works fine - except the quick tips ofcourse =) But why is it causing problems? Is it because I'm using it wrong, placing it wrong or just because it doesn't like IE and IFrames? Link: Link to the IFrame page IFrame page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <body> <iframe height="660" src="http://www.gis34.dk/doctype.html" width="660"> <p>Din browser understøtter ikke <i>frames</i>.</p> </iframe> </body> </html> Application page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" language="javascript"> var map; var mapPanel; var mainViewport; var toolbarItems = []; </script> <link href="/Libraries/Ext/resources/css/ext-all.css" type="text/css" rel="stylesheet" /> <link href="/Libraries/GeoExt/resources/css/geoext-all-debug.css" type="text/css" rel="stylesheet" /> <link href="/CSS/Extjs.css" type="text/css" rel="stylesheet" /> <link href="/CSS/OpenLayers.css" type="text/css" rel="stylesheet" /> <link href="/CSS/Poseidon.css" type="text/css" rel="stylesheet" /> </head> <body> <script src="/Libraries/OpenLayers/lib/OpenLayers.js" type="text/javascript"></script> <script src="/Libraries/Ext/adapter/ext/ext-base-debug.js" type="text/javascript"></script> <script src="/Libraries/Ext/ext-all-debug.js" type="text/javascript"></script> <script src="/Libraries/GeoExt/lib/GeoExt.js" type="text/javascript"></script> <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js" type="text/javascript"></script> <div id="map"></div> <script type="text/javascript"> Ext.onReady(function() { Ext.QuickTips.init(); Ext.BLANK_IMAGE_URL = '/Libraries/Ext/resources/images/default/s.gif'; var layer = new OpenLayers.Layer.OSM.Mapnik( 'OpenStreetMap Mapnik', { sphericalMercator: true }, { isBaseLayer: true } ); var mapOptions = { projection: 'EPSG:900913', units: 'm', maxExtent: new OpenLayers.Bounds(1390414.0280576,7490505.7050394,1406198.2743956,7501990.3685372), minResolution: '0.125', maxResolution: '1000', restrictedExtent: new OpenLayers.Bounds(1390414.0280576,7490505.7050394,1406198.2743956,7501990.3685372), controls: [ ] }; map = new OpenLayers.Map('', mapOptions); var Navigation = new OpenLayers.Control.Navigation(); action = new GeoExt.Action( { control: new OpenLayers.Control.ZoomBox({out:false}), map: map, tooltip: "Zoom ind", iconCls: 'icon-zoom-in', toggleGroup: 'mapTools', group: 'mapTools' }); toolbarItems.push(action); action = new GeoExt.Action( { control: new OpenLayers.Control.ZoomBox({out:true}), map: map, tooltip: "Zoom ud", iconCls: 'icon-zoom-out', toggleGroup: 'mapTools', group: 'mapTools' }); toolbarItems.push(action); action = new GeoExt.Action({ control: new OpenLayers.Control.ZoomToMaxExtent(), map: map, iconCls: 'icon-zoom-max-extent', tooltip: 'Zoom helt ud' }); toolbarItems.push(action); map.addControl(Navigation); map.addLayer(layer); mapPanel = new GeoExt.MapPanel( { border: true, id: 'mapPanel', region: "center", map: map, tbar: toolbarItems }); mainViewport = new Ext.Viewport( { layout: "fit", hideBorders: true, items: { layout: "border", deferredRender: false, items: [ mapPanel ] } }); }); </script> </body> </html>

    Read the article

  • UIToolbar UIBarButtonItem Alignment question

    - by Luther Baker
    I need to create a UIToolbar that has two UIBarButtonItems. The 1st button must be centered and the 2nd item must be right aligned. I understand and use Flexible spacing and it works great when I need to balance buttons across the UIToolbar, but with only two buttons, I can't seem to perfectly center the middle button. I've even initialized the view.toolbarItems array with NSArray *items = [[NSArray alloc] initWithObjects:fixed, flex, center_button, flex, right_button, nil]; and set fixed.width = right_button.width ... but still, the center_button is never perfectly centered.

    Read the article

  • problem with adding tool bar to UITableView

    - by chnet
    I'm writing a Navigation-Based iPhone app, and I'd like to have a UIToolBar docked at the bottom of my screen, with a UITableView scrolling between the tool bar and the navigation bar. I used [[self navigationController] setToolbarHidden:NO] and - (void)setToolbarItems:(NSArray *)toolbarItems animated:(BOOL)animated to set the UIToolBar. UIToolBar correctly shows in current view. If I drill down into a detail view using the button on navigation bar, i cannot return back to previous view. Before I add the tool bar, it can return back. I am wondering is there anything else should be noted when use UIToolbar?

    Read the article

  • UIViewController: setToolbarItems vs navigationItem

    - by Paul Sanwald
    my application has a UIViewController subclass which is being managed by a UINavigationController. In the viewDidLoad of my UIViewController subclass, I was attempting to add a UIBarButtonItem to the toolbar like this: settingsButton = [[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStylePlain target:self action:@selector(viewSettings:)]; [self setToolbarItems:[NSArray arrayWithObject:settingsButton]]; this wasn't working out for me, so after some googling around, I tried this: [[self navigationItem] setRightBarButtonItem:settingsButton]; which worked out fine. from reading the UIViewController documentation, I'm still confused about why setToolbarItems wasn't working. I verified in the debugger that the button was in the toolbarItems array in the viewDidAppear method. the button itself just wasn't appearing on my toolbar. so, my question is, why didn't setToolbarItems work for me in the first code snippet? I don't have the toolbar configured in my xib for this view controller at all, if that makes a difference.

    Read the article

  • Toolbar items in sub-nib

    - by roe
    This question has probably been asked before, but my google-fu must be inferior to everybody else's, cause I can't figure this out. I'm playing around with the iPhone SDK, and I'm building a concept app I've been thinking about. If we have a look at the skeleton generated with a navigation based app, the MainWindow.xib contains a navigation controller, and within that a root-view controller (and a navigation bar and toolbar if you play around with it a little). The root-view controller has the RootViewController-nib associated with it, which loads the table-view. So far so good. To add content to the tool bar and to the navigation bar, I'm supposed to add those to in the hierarchy below the Root View Controller (which works, no problem). However, what I can't figure out is, this is all still within the MainWindow.xib (or, at runtime, nib). How would I define a xib in order for it to pick up tool bar items from that? I want to do (the equivalent of, just reusing the name here) RootViewController *controller = [[RootViewController alloc] initWithNibName:nil bundle:nil]; [self.navigationController pushViewController:controller animated:YES]; [controller release]; and have the navigation controller pick-up on the tool bar items defined in that nib. The logical place to put it would be in the hierarchy under File's Owner (which is of type RootViewController), but it doesn't appear to be possible. Currently, I'm assigning these (navigationItem and toolbarItems) manually in the viewDidLoad method, or define them in the MainWindow.xib directly to be loaded when the app initializes. Any ideas? Edit I guess I'll try to explain with a picture. This is the Interface Builder of the main window, pretty much as it comes out of the wizard to create a navigation based project. I've added a toolbar item for clarity though. You can see the navigation controller, with a toolbar and a navigation bar, and the root view controller. Basically, the Root View Controller has a bar button item and a navigation item as you can see. The thing is, it's also got a nib associated with it, which, when loaded will instantiate a view, and assign it to the view outlet of the controller (which in that nib is File's Owner, of type RootViewController, as should be). How can I get the toolbar item, and the navigation item, into the other nib, the RootViewController.nib so I can remove them here. The RootViewController.nib adds everything else to the Root View Controller, why not these items? The background for this is that I want to simply instantiate RootViewController, initialize it with its own nib (i.e. initWithNibName:nil shown above), and push it onto the navigation controller, without having to add the navigation/toolbar items in coding (as I do it now).

    Read the article

1