Custom icon for bar button item on iPhone?

Hey all,
I'm trying to set a custom image as a bar button item in my iPhone app and can't figure it out. I don't want the image inside a button, I want the image to be the button itself. If I use initWithCustomView the area isn't clickable anymore (unless I'm missing something).
Does anyone know how to do this?
Thanks,
Mike O.

I am having the exact same problem, but I cannot figure out the solution. I tried initWithCustomView: with a UIImageView, and then with a UIButton. If I set the UIBarButtonItem's target and action, that method does NOT get called in either scenario, and when i set the UIButton's target and action in the latter scenario, it STILL does not get called. Could you post your working sample code? Here is an example of my code which DOES NOT WORK!
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:[UIImage imageNamed:@"NowPlaying.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(nowPlayingButtonClicked) forControlEvents:UIControlEventTouchUpInside];
nowPlaying = [[UIBarButtonItem alloc] initWithCustomView:button];
nowPlaying.action = @selector(nowPlayingButtonClicked);
nowPlaying.target = self;
Thanks for your help.
Message was edited by: Ben Sussman

Similar Messages

  • Custom Icon for application file

    I can make director allow me to have a custom icon for appliacation file.
    In director I have attempted this several times where I have tried to have my appliaction file have an icon.  I have purchased two icon program Candy Bar and Fastincs trying to remedy this problem.
    As you see here I am using an ins file created in Fastincs.  Now here is an image to the path and the icon itself Applipcations/ Adobe Director 11/3 HorseLogo.mac.ins
    So there is the setup now when I complile for my program file I get this.
    See the grey Director icon I don't want that I want the three horse logo.
    I also tried to assign the logo after publishing the file.
    then I drag my icon file in
    The program created in director still wont see the icon file.
    If I use Candy bar (icon application)  I get a  different result. The icon works
    in both finder and on the task bar
    This is exactly what I want.
    I works until I try to move the entire package into an installer program  I am using BitRock.  When I compile the installation program then try to run the application I get the following message
    If I choose ignore the install continues.  But I have no icon.
    I am desperate , weeping , screaming , and almost a lost cause, any help any help at all I could really use.
    Thanks
    Robin aka innish

    Hi Robin,
    I'm more of a PC person rather than Mac. I would recommend you look at the Resource and Icon Editor page at:
    http://collab.directorforum.com/Resource_and_Icon_Editor
    It may fix your icon issue from Director.
    Dean

  • Set Icon for toggle button

    I created Icon with Borderpane, image and text which I want to set as button icon.
    @Override
        public void start(Stage primaryStage)
            final VBox vbox = new VBox();
            // create 3 toggle buttons and a toogle group for them
            ToggleButton tb1 = new ToggleButton();
            tb1.setGraphic(newConnectionIcon());
            ToggleButton tb2 = new ToggleButton();
            ToggleButton tb3 = new ToggleButton();
            final ToggleGroup group = new ToggleGroup();
            tb1.setToggleGroup(group);
            tb2.setToggleGroup(group);
            tb3.setToggleGroup(group);
            // select the first button to start with
            group.selectToggle(tb1);
            final Rectangle rect1 = new Rectangle(300, 300);
            rect1.setFill(Color.DARKOLIVEGREEN);
            final Rectangle rect2 = new Rectangle(300, 300);
            rect2.setFill(Color.LAVENDER);
            final Rectangle rect3 = new Rectangle(300, 300);
            rect3.setFill(Color.LIGHTSLATEGREY);
            tb1.setUserData(rect1);
            tb2.setUserData(rect2);
            tb3.setUserData(rect3);
            group.selectedToggleProperty().addListener(new ChangeListener<Toggle>()
                @Override
                public void changed(ObservableValue<? extends Toggle> ov, Toggle toggle, Toggle new_toggle)
                    if (new_toggle == null)
                    else
                        vbox.getChildren().set(1, (Node) group.getSelectedToggle().getUserData());
            HBox hBox = new HBox();
            hBox.getChildren().addAll(tb1, tb2, tb3);
            hBox.setPadding(new Insets(10, 10, 10, 10));
            vbox.getChildren().addAll(hBox, (Node) group.getSelectedToggle().getUserData());
            StackPane root = new StackPane();
            root.getChildren().add(vbox);
            Scene scene = new Scene(root, 800, 850);
            primaryStage.setScene(scene);
            primaryStage.show();
        private static BorderPane newConnectionIcon() {
            // Add background effect
            DropShadow ds = new DropShadow();
            ds.setOffsetY(2.0);
            ds.setOffsetX(2.0);
            ds.setColor(Color.GRAY);
            // New BorderPane which will hold the components
            bpi = new BorderPane();
            bpi.setEffect(ds);  // Add the effect
            bpi.setCache(true);
            // Set the size of the BorderPane
            bpi.setPrefSize(30, 30);
            bpi.setMaxSize(30, 30);
            // Add style       
            bpi.setStyle("-fx-background-color: linear-gradient(#f2f2f2, #d4d4d4);"
                    + "  -fx-background-insets: 0 0 -1 0, 0, 1, 2;"
                    + "  -fx-background-radius: 3px, 3px, 2px, 1px;");
            // Add Label to the Icon
            Text inftx = new Text("New Connection");
            inftx.setFont(Font.font ("Verdana", 5));   // Set font and font size
            inftx.setFill(Color.WHITE); // Set font color
            ncpic.setFitHeight(25);    // Set size of the Icon picture
            ncpic.setFitWidth(25);
            // Internal StackPane which will hold the picture and the Icon Label
            StackPane stack = new StackPane();
            stack.getChildren().addAll(ncpic, inftx);   // Add the picture and the Label
            // Add the StackPane to the main BorderPane       
            bpi.setCenter(stack);
            // Change the border of the Icon when the mouse is over the Icon
            bpi = mouseOver(bpi);
            // Navigate to new Panel when the user clicks on the Icon
            bpi.setOnMouseClicked(new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent t) {
            return bpi;
    How I can remove the default togglebutton and use the my custom icon as a button?

    Yes, they are icons and they are called "handles". The easiest way to change then is to use UIManager.
    If you haven't done so before, look through the hash table UIManager.getLookAndFeelDefaults().
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    public class TreeIcons {
         public static void main(String[] args) throws MalformedURLException {
              String prefix = "http://forum.java.sun.com/images/";
              UIManager.put("Tree.openIcon", new ImageIcon(new URL(prefix + "dont_save.gif")));
              UIManager.put("Tree.closedIcon", new ImageIcon(new URL(prefix + "save.gif")));
              UIManager.put("Tree.leafIcon", new ImageIcon(new URL(prefix + "forum_new.gif")));
              UIManager.put("Tree.expandedIcon", new ImageIcon(new URL(prefix + "email_faded.gif")));
              UIManager.put("Tree.collapsedIcon", new ImageIcon(new URL(prefix + "email.gif")));
              JFrame f = new JFrame("TreeIcons");
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.getContentPane().add(new JTree());
              f.setSize(new Dimension(300,400));
              f.setLocationRelativeTo(null);
              f.setVisible(true);
    }

  • Custom icon for module_webappsresultsmap

    As the title says...
    When you make a search on the Google map, the icon that shows where the place  is, is a standard Google Map icon.
    Is it possible to override and add a custom icon for this?
    It would be nice to have it within the tag...
    ie. {module_webappsresultsmap,GoogleKey,width,height,ResultsPage,SortType,Image}
    Or have the image within the web app so that each location has a different icon.

    I tried submitting this same problem as a feature request and/or bug report.
    Unfortunately, and somewhat disconcertingly, the Captivate Bug Report form also doesn't work. No matter how thoroughly I entered my request, I got these error messages:
    The following error(s) must be corrected before this form can be completed:
    Please enter your name
    Please enter your E-mail address
    Please select if it is feature request or the bug report.
    Please select a product
    Please enter the issue description

  • Custom icon for Boot Camp partition on Snow Leopard desktop?

    I have a Boot Camp partition (NTFS) with Windows XP. In Snow Leopard, the partition shows on the desktop with a generic hard drive icon. I'd like to change this to a custom icon, but when trying to paste over the generic icon in the Get Info window, Edit->Paste is grayed out.
    In Leopard, it was possible to have a custom icon for a Boot Camp partition by formatting a thumb drive as FAT32, pasting the custom icon onto it in the Get Info window, booting into Windows XP, and copying two invisible icon files from the thumb drive to the NTFS drive. This would display the custom icon for the Boot Camp partition icon on the Leopard desktop. This doesn't work in Snow Leopard.
    Is it possible to use a custom icon for a Boot Camp partition on the Snow Leopard desktop?

    I don't see this option in Properties for the Boot Camp volume. In any case, I believe the custom icon is set correctly for the C: drive in Windows. I followed he procedure in the second paragraph of my initial post, which I learned from a post over a year ago. I copied the two hidden files .VolumeIcons.icns and ._ File _ to the C: drive. When I boot into Leopard, the correct custom icon for the Boot Camp partition appears on the Leopard desktop. But when I boot into Snow Leopard, only a generic hard drive icon appears on the desktop for that partition.

  • Custom icon for Boot Camp partition?

    I have a Boot Camp partition (NTFS) with Windows XP. In Snow Leopard, the partition shows on the desktop with a generic hard drive icon. I'd like to change this to a custom icon, but when trying to paste over the generic icon in the Get Info window, Edit-->Paste is grayed out.
    In Leopard, it was possible to use a custom icon for a Boot Camp partition by formatting a thumb drive as FAT32, pasting the custom icon onto it in the Get Info window, booting into Windows XP, and copying two invisible icon files from the thumb drive to the NTFS drive. This would display the custom icon for the Boot Camp partition icon on the Leopard desktop. This doesn't appear to work in Snow Leopard.
    Is it possible to use a custom icon for a Boot Camp partition on the Snow Leopard desktop?

    No one knows of any fix for this in Snow Leopard? The custom icon shows up OK when I boot into Leopard, but not in Snow Leopard.

  • Custom Icon for Lync Custom Menus

    We can create custom menus in LYNC Client by setting some  registry values.  But we are not able set custom icons fro the same(instead of default ICON). Is there any to set custom Icon for Custom Menus.
    Thanks in advance,

    No the icon is not configurable via the registry values.

  • Custom icon for my USB flash drive?

    Alright, now I realize I'm probably missing something here, but it's getting away from me here. All I want to do is have a custom icon for my flash drive that will show up on any Mac that I plug it into.
    As it is, I can assign a coustom icon (by doing the old get-info-copy-and-paste-the-icon thingie), but it doesn't show up when I plug it into another Mac. I just get the generic disk icon. What am I missing? This has to be quite simple.

    Trey,
    I may be PITW, but I think the icons used to represent various volumes/devices are (if customized) specific to a system (not the volume/device). Thus you would have to set the custom icon for your flash drive on each system you wanted to see it.
    A WAG: I haven't the slightest idea if it would work for a flash drive, but for a CD one would drag the custom icon (.icns file) to the root level of the CD and rename it .VolumeIcon.icns before burning the CD.
    Lee C
    "The early bird may get the worm but the second mouse gets the cheese." -- Willie Nelson
    See the article Backup::Restore.
    Dual 2.5 Power Mac G5   Mac OS X (10.4.3)  

  • Custom icon for boot camp disk?

    I have a Win XP boot camp disk partition (NTFS file system) on an internal hard drive. I want to use a custom icon for this partition on my OS X desktop. However, when I select the icon of this partition in a Get Info window, the only Edit option that ever appears is to Copy the icon. That is, I cannot paste another icon over it (the Paste option is grayed out).
    Is this due to the partition being Windows? Is there a way other than the Get Info method for applying a custom icon? I'm using 10.5.2, but the same thing happened with 10.5.1, and also using a fresh test account.

    Did you know you could have converted the drive to NTFS within Window (not reformatting and losing everything)? I converted mine from FAT32 to NTFS a few months back, lucky for me I already had a drive icon in OSX so the conversion kept the icon.
    For your case though, do this:
    1) Paste your icon (in the Get Info window) onto a USB thumb drive formatted as FAT32. The name of the drive doesn't matter.
    2) Launch Windows through Boot Camp, Parallels Desktop, or VMware Fusion.
    3) Open the thumb drive in Windows.
    4) Select Folder Options… from the Tools menu, and set it to show invisible files.
    5) Copy the two files .VolumeIcon.icns and ._[cr]File, where [cr] is a carriage return, to the NTFS drive.

  • Custom Icon for Windows.exe from a Mac

    It doesn't seem possible to insert a custom icon for a Windows executable when working on Captivate on a Mac, is that right? The documentation (below) seems to gloss over this shortcoming.
    Custom Icon
    You can customize the icon that is displayed for the executable file. Click Browse (...) to add a custom icon for your file. Ensure that the icon file has a .ico extension (on Windows)/.icns (for Mac).

    I tried submitting this same problem as a feature request and/or bug report.
    Unfortunately, and somewhat disconcertingly, the Captivate Bug Report form also doesn't work. No matter how thoroughly I entered my request, I got these error messages:
    The following error(s) must be corrected before this form can be completed:
    Please enter your name
    Please enter your E-mail address
    Please select if it is feature request or the bug report.
    Please select a product
    Please enter the issue description

  • Should custom icons for USB appear on other Macs?

    I have a custom icon for my flash / usb drive that doesn't appear in other Mac computers. The default icon appears. I haven't been able to test it on another Leopard Mac.
    Is this regular behavior or not? Is there a way to make other Macs show it? I looked around for info about this and didn't see it. Thanks, guru pals.

    Normal. Stored in launchservices.plist, I think. But it is normal. Not like an MP3, where the album art can be stored on the file.

  • ICON for a Button( Forms 4.5)

    I am trying to show an ICON for a Button
    in Forms 4.5 under Windows OS.
    I am not able to find any of these
    TK_ICON, UI_ICON and TK25_ICON in the registry
    to set the path.
    Shoud I have to install any other utility/option ?
    please guide me

    Just create the new registry entries by yourself under
    H_KEY_LOCAL_MACHINE/SOFTWARE/ORACLE and write the correct path
    inot it.
    Michael

  • Is it worth it to make custom icons for a custom control/indicator?

    I was making custom icons (well not very custom, but still at least somet ext) for controls and indicators, when I realized that the only times you see them are when you open the control, itself, ot if you hover over it in the project with context help on.
    So the question is:
    Is it worth it to create a custom icon for each custom control you make, if it will be seen only rarely?  (The exception being a cluster, since, in the later versions of LabVIEW, you can actually represent your cluster on the BD as the icon you made for it, so it definitely IS worth it to make an icon for it.)
    Thanks!
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
    Solved!
    Go to Solution.

    Hooovahh wrote:
    I'd like to add another time that you see the control's icon, is when it is a type def cluster, and you have it as a constant on the block diagram.  Then double click the border to shrink the cluster.  It will shrink to the size of the control's icon.
    I also hardly ever make a control icon.  Only when it is on the palette in a reuse package.
    Yeah,t hat's what I meant in my original post, although you CAN represent a cluster constant on the BD as an icon - but it's just the little thing on the bottom of the typdef'd cluster because it obviously has no actual icon. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Simple question! Is it possible to have a custom icon for an app part?

    Hi All
    Title says it all: is it possible to have a custom icon for an app part / client web part?
    It used to be straightforward with the previous dev tools, but the ImageUrl was typically to a hive folder (which is obviously out of bounds now).
    I've "Binged" with no joy. None of the samples I've seen have a custom icon.
    So - can it be done?
    Regards
    Nigel

    Hi Nigel,
    Updating the AppIcon.png in Napa
    You can upload a new AppIcon.png in into the /Images folder in the file tree in Napa:
    Updating the AppIcon.png in Visual Studio 20102
    You can update a new AppIcon.png in into the Images folder in your Visual Studio solution:
    Keith Tuomi | Twitter: @itgroove_keith | Blog:
    http://yalla.itgroove.net
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.

  • Change title, tooltip and icon for About button in published Webhelp?

    About Webhelp  is just plain wrong.  The tooltip ought to read "About <project name>" and the title bar for the About window should be eliminated (or else have it read About <project ver xx>.
    How do I do this?
    Likewise, is it possible to change the ICON for the About dialog in the toolbar of a published Webhelp project?

    I have the same issue.
    I modified the whskin_banner.htm file to control what displays for the About button.  The only thing I can't figure out is how to modify the tooltip.  It still says "About Webhelp" when you hover over it.
    I searched the whskin_banner.html file for the words "About Webhelp" but nothing was found.  I looked in the Edit Skin wizard and couldn't find anything either.  I also searched the Skinny on Skins and it doesn't address this issue.
    How do I change the About tooltip? Did I miss something?
    Thanks!

Maybe you are looking for

  • Connect Coldusion to Oracle when encryption connection is enabled

    We have had ColdFusion 8.0.1 connected to Oracle (11g r2) with no problem until we encrypted the Oracle connections. All our software tools had no problem still connecting except Coldfusion. Supposedly encryption changes should only have been server

  • Should I be entitled to Home Hub 4

    Hi all, I joined BT from Virgin Media after June 1st. I am on the unlimited 2 package but was fitted with a Home hub 3 which has consistently failed to work since fitted. After 3 complaints it is finally being changed to.....another home hub 3. As I

  • Adding RADIUS VSAs on ACS 3.2 SE

    I have tried to add a VSA to enable a Packeteer to authenticate using RADIUS on the ACS. Using RDBMS synchronization to import the csv file below. SequenceId,Priority,GroupName,Action,ValueName ,Value1,Value2,Value3 1,1,External,163,26,access=look,23

  • Cannot get system date. My input format is %Y%m%d and the output is also a format 'YYYYMMDD'?

    Dear all, I am using Labview 8.5. I am trying to get system date. I use Format Date/Time String tool in a "%Y%m%d" format. The PROBLEM is the Format Date/Time String return 'YYYYMMDD' only.  Please see my attachment to see. Please help me with this,

  • Installation of SQL Server 2008 failing - Client Tools

    Hello, I am trying to install SQL Server 2008 Client Tools on a machine that already has SQL Server 2005 (Full install). I select "Client Tools Connectivity" "Client Tools Backwards Compatibility" "Client Tools SDK" and "SQL Client Connectivity SDK".