Images and buttons

I want to load an image onto the screen and allow the user to touch parts of the image to trigger an event.
I can get an UIImageView with an image to load onto the screen, but it seems to hide the button I put in place with IB. How can I "hide" the image behind the button so the button will work?
Is this easier working out of the viewcontroller object or creating a uiview object? Right now, I can only get the image to load if I use a uiview object.
Should I define the IBAction method for the button in the uiviewcontroller or uiview?

If you need to know where the touch occurred on the image, take darkpegusus' advice and subclass UIImageView so you can override the touch methods.
However if you only need to know if the image was touched and don't need the location, a button would work fine and is much easier to program than a subclass.
You asked how to hide the image. For that all you'd need to do is put a button on top of the image. You'd do that in IB by dragging a button onto the image, then going to the xib window (the window with icons such as File's Owner; if you don't see it select Window->Document). At the left end of the toolbar select ViewMode->center (the switch with 4 horizontal lines). Now expand the content view (probably the bottom icon; it won't be called content view, but it's the view that contains your image view). You should now see your UIImageView and your UIButton as children of the content view. The button will be on top of the image view when it's lower in the list. If the button isn't at the bottom of the list, drag it lower. The button may try to leave the list of children, but make sure it goes into the list (indented) at the bottom. You should now see the button on top of the image view.
Note that the above procedure makes the button hide the part of the view under it. But I suspect you may have meant "Put the button over the image so it will respond to a touch, but hide the button". If that's what you want, you need an invisible button. You can't do this by setting the button's alpha to zero, because it will no longer respond (alpha needs to be above 0.2 before a view will respond to touch). You also can't change the background of a rounded rect button to clear. It will always be drawn white.
For an invisible button, what you want is a "custom" type UIButton. Select the button, bring up the Attributes Inspector and at the top of the panel, change the Type to Custom. Next select the image view and bring up the Size Inspector. Write down the x, y, width, height for the image view, then select the button again and set it's dimensions to those numbers in the Size Inspector. You should now have an Invisible button which exactly covers the image view.
Re your last questions, your UIImageView and UIButton must be added to a view (the IB editor window might be named View Controller, but when you add something to that editor window, it will be added to the controller's view, not the controller itself. I.e. whether or not you use a view controller, controls and other subview are always added to a view object as shown in the xib window.
If you have a controller, you should "control" the button and image from the controller object. In other words, you'll have your own subclass of UIViewController with instance variables for all the controls on the content view (the view controller's view). You can specify IBOutlet for those instance vars and connect them to the correct controls in IB. Similarly, your view controller subclass should define IBAction methods for each button (or other control), and you make the connection from the buttons to the methold in IB.

Similar Messages

  • Many images and buttons on websites are not visible and appear as white space.

    i am unable to see buttons such as the "buy now" button, but when i scroll over the white space, the cursor changes to alert me that i've found the button. also, websites i frequent are now missing images and logos on this computer. i am windows XP pro, firefox browser. thanks for any assistance.

    -> click '''Firefox''' button and click '''Options''' -> Content panel -> place Checkmark on '''Load Images Automatically''' -> click '''Exceptions...''' button and click '''Remove All''' -> Now type the address of websites on which you want Images to appear e.g. '''msn.com''' , '''yahoo.com''' , '''google.com''' , etc. -> click '''Allow''' for each, One by One -> click Close - > click OK on Options window -> Restart Firefox
    -> Go to your concerned websites
    * Right-click empty space within the page and click '''View Page Info'''
    * In the '''Page Info''' window, select the '''Media''' panel and Remove Checkmark from '''Block Images'''
    * In the '''Page Info''' window, select the '''Permissions''' panel
    * Under '''Load Images''', Change the setting to '''Allow'''
    * Under '''Set Cookies''', place Checkmark on '''Use Default''' and Change the setting to '''Allow'''
    * Close the Page Info window
    Also see this - Images or Animations do not show
    * https://support.mozilla.com/en-US/kb/Images%20or%20animations%20do%20not%20show
    * http://kb.mozillazine.org/Images_or_animations_do_not_load
    Check and tell if its working.

  • Help with images and buttons

    I was wondering if anyone could recommend a tutorial or point me in the right direction. I've been trying to figure out how to use buttons to add images (been using png from photoshop with alphachannel) to a canvas. I don't have any problems skinning the buttons nor putting in a single image, nor text. As far as getting the images to layer when the buttons are clicked then I'm pretty lost. Not sure if an array is best or if adding and removing them as children in another container would be any easier..

    I've been using flash builder beta 2. I was planning on embedding the images. I'm not sure if the help files and examples I am reading are not compatible or if I just have the syntax wrong. I haven't been able to find any examples that use embedded images and toggle visibility. I've used spark components. In design mode it puts the code in for a button when drag-dropped, then recommends using spark component instead. It seems that the only time that the images really do anything is when there's a spark component.
    I've never used flex before would it be easier to use wordpad and try compiling it with something other than flash builder?

  • How can I create clearer, sharper images and buttons in Muse?

    How can I create buttons and images that have a vector like clarity? When I upload images (buttons, jpegs and pngs) a lot of the time they seem to have a slightly fuzzy quality to them. I have read previous posts on this matter and none have helped. Any feedback on this will be greatly appreciated. Thanks

    When you place your images in exactly the size you saved them in Photoshop or whatever, Muse doesn’t touch it.
    The quality in this case is the quality you saved the image.
    The best way is, to examine in Muse the available pixel size of the image and then use Photoshop to obtain this size
    A helpful widget to examine the potential size of an image in advance, is the "lore ipsum"-Muse-widget, that you find in the free widget collection "Andrew’s Prototypes":
    Andrew Prototypes | Exchange | Adobe Muse CC

  • Upgrading APEX from 3.2 to 4.0 images and buttons not displaying correctly

    Database 11.2.0.1
    APEX: 3.2.1
    Attemping to upgrade APEX from 3.2 to 4.0. The installation script runs fine and updates the database successfully. I run the .sql to import the images and it ran successfully however when I attempt to access the APEX home page, the images are not loaded and the buttons don't do anything. I did some research through google but did not come to anything that resolved my issue. Does anyone have any ideas?
    Thanks for your time...

    If you are using mod_plsql, you need to run @apxldimg.sql script with SYS user file present with Apex installation. Also provide the location of your apex folder as parameter to this script.
    Habib

  • Adding images and buttons without a frame appearing

    I would like to add images to some of my pages without having them appear in a frame. I would like to place some transparent gifs on the page to use as buttons for hyperlinks. I would also like to have some photos (with transparent backgrounds that appear on the page and are not surrounded by a picture frame. Any Suggestions

    iWeb seems to default to stroking newly-added images and shapes. Pages (iWeb's close relation) includes a way to change the default appearance, but I can't find anything similar in iWeb. You can, of course, remove the stroke using the Graphic Inspector (just set Stroke to None). Transparency in gifs and photo images is supported. Just drag into iWeb or use Insert > Choose... Again, remove the stroke if this appears.

  • Background image and buttons

    I got 4 different images. I want to use these images as a background.
    They have to change as soon as the buttons is clicked. I got four buttons.
    Name of the pichtures image1.jpg etc
    the buttons btn1 etc
    I think its possible but i dont know how to work with backgrounds

    ok, that is a start, but as i said im not a real flash user and creater.
    So im gonna need some extra help,
    You might remember kglad that you helped me before. if not I'll post the script.
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var bar1s:Number = 73.05;
    var bar1e:Number = 665;
    var bar2s:Number = 37.85;
    var bar2e:Number = 630;
    var bar3s:Number = 1.6;
    var bar3e:Number = 595;
    var time:Number = 2;
    trace("bar 1 start" + tweenRight11 +" start "+ bar2s +" end "+ bar2e);
    trace ("The X position of myBox_mc is "+ bar2.x);
    bar1.addEventListener(MouseEvent.CLICK, movebar1);
    var tweenRight11:Tween;
    var tweenLeft11:Tween;
    var tweenLeft12:Tween;
    var tweenLeft13:Tween;
    var tweenLeft14:Tween;
    var tweenLeft15:Tween;
    var tweenLeft16:Tween;
    function movebar1(e:MouseEvent):void{
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2s)< 2) && (Math.abs(bar1.x-bar1s)< 2)){
         tweenRight11 = new Tween(bar1, "x", Strong.easeOut, bar1s, bar1e, time, true);
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2s)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
         tweenLeft11 = new Tween(bar1, "x", Strong.easeOut, bar1e, bar1s, time, true);   
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2e)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
         tweenLeft12 = new Tween(bar1, "x", Strong.easeOut, bar1e, bar1s, time, true);
         tweenLeft13 = new Tween(bar2, "x", Strong.easeOut, bar2e, bar2s, time, true);
         if  ((Math.abs(bar3.x-bar3e)<2) && (Math.abs(bar2.x-bar2e)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
         tweenLeft14 = new Tween(bar1, "x", Strong.easeOut, bar1e, bar1s, time, true);
         tweenLeft15 = new Tween(bar2, "x", Strong.easeOut, bar2e, bar2s, time, true);
         tweenLeft16 = new Tween(bar3, "x", Strong.easeOut, bar3e, bar3s, time, true);
    bar2.addEventListener(MouseEvent.CLICK, movebar2);
    var tweenRight21:Tween;
    var tweenRight22:Tween;
    var tweenRight23:Tween;
    var tweenLeft21:Tween;
    var tweenLeft22:Tween;
    var tweenLeft23:Tween;
    function movebar2(e:MouseEvent):void{
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2s)< 2) && (Math.abs(bar1.x-bar1s)< 2)){
         tweenRight21 = new Tween(bar1, "x", Strong.easeOut, bar1s, bar1e, time, true);
        tweenRight22 = new Tween(bar2, "x", Strong.easeOut, bar2s, bar2e, time, true);
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2s)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
        tweenRight23 = new Tween(bar2, "x", Strong.easeOut, bar2s, bar2e, time, true);
         if  ((Math.abs(bar3.x-bar3e)<2) && (Math.abs(bar2.x-bar2e)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
         tweenLeft21 = new Tween(bar2, "x", Strong.easeOut, bar2e, bar2s, time, true);
         tweenLeft22 = new Tween(bar3, "x", Strong.easeOut, bar3e, bar3s, time, true);
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2e)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
         tweenLeft23 = new Tween(bar2, "x", Strong.easeOut, bar2e, bar2s, time, true);
    bar3.addEventListener(MouseEvent.CLICK, movebar3);
    var tweenRight31:Tween;
    var tweenRight32:Tween;
    var tweenRight33:Tween;
    var tweenRight34:Tween;
    var tweenRight35:Tween;
    var tweenRight36:Tween;
    var tweenLeft31:Tween;
    function movebar3(e:MouseEvent):void{
         trace(bar3.x,bar3s,bar3e,":",bar2.x,bar2s,bar2e,":",bar1.x,bar1s,bar1e);
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2s)< 2) && (Math.abs(bar1.x-bar1s)< 2)){
         tweenRight31 = new Tween(bar1, "x", Strong.easeOut, bar1s, bar1e, time, true);
        tweenRight32 = new Tween(bar2, "x", Strong.easeOut, bar2s, bar2e, time, true);
         tweenRight33 = new Tween(bar3, "x", Strong.easeOut, bar3s, bar3e, time, true);
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2s)< 2) && (Math.abs(bar1.x-bar1e)< 2)) {
         tweenRight34 = new Tween(bar2, "x", Strong.easeOut, bar2s, bar2e, time, true);
         tweenRight35 = new Tween(bar3, "x", Strong.easeOut, bar3s, bar3e, time, true);
         if  ((Math.abs(bar3.x-bar3s)<2) && (Math.abs(bar2.x-bar2e)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
         tweenRight36 = new Tween(bar3, "x", Strong.easeOut, bar3s, bar3e, time, true);
         if  ((Math.abs(bar3.x-bar3e)<2) && (Math.abs(bar2.x-bar2e)< 2) && (Math.abs(bar1.x-bar1e)< 2)){
         tweenLeft31 = new Tween(bar3, "x", Strong.easeOut, bar3e, bar3s, time, true);
    You see that the button is the bar and slides, that is all working and tested real good. Now that is the bar is clicked and that will move the bar but it will have to change the background
    what do you think

  • Background and buttons upside down and mirrored

    Hello
    I have a brand new dvd studio Pro …3
    so i am starting with the basic and minimum project : menus with a simple backgroung ( jpg image) and a single button that bring to the next menu. but…
    If i don't put any text or single letter in the button, it works normaly
    if i put just a letter in the button, the result is an upside-down image and button.
    Thank you for helping me
    sincerely
    pascal

    Welcome to the forums
    One thing to check is your video card, some video cards produced upside down/reversed images or menus, though I do not recall seeing that happen (did not see what computer you have or video card)
    Just took a quick look and did not see a reverse setting or mirror for text

  • Customizing UITableViewCell (image, label, button).

    I have an image and 4 UILabels in my tableViewCell. I need the image to be selectable and two labels to be selectable. I searched in documentation and I found nothing about writing selector for UILabel. So, I am trying to use UIButtons ( UIButtonTypeCustom) instead of the two UILabels. But, when I touch the cell the entire cell is selectable. How can I differentiate the labels, image and buttons in my UITableViewCell.
    I need the image to be selectable. I wanted to add a video in place of the image.
    How can I make all this possible.
    Thank You.

    http://www.iphonesdkarticles.com/2008/08/table-view-tutorial-tableview-cell.html
    http://iphoneincubator.com/blog/windows-views/display-rich-text-using-a-uiwebvie w
    Google is your friend...

  • I am not able to import photos into Lightroom 5.7.  When I select a folder, it doesn't show a preview of the images and the import button is greyed out. ??

    I am not able to import photos into Lightroom 5.7.  When I select a folder, it doesn't show a preview of the images and the import button is greyed out. ??
    I have been using Lightroom 5 for 2-3 months now and all worked well, up until today's effort to import a new set of photos. I am working on a Mac with Yosemite 10.10.1.

    Go to the bibliothec module, select the folder, right click on the folder and hit synchronize
    Sorry I have only a german version , so don't know what your menu will show.

  • Images as Buttons and Image Resizing in mxml

    Sorry for all the questions but I've run into a problem when trying to create buttons that are just an image in mxml. When I first tried this I couldn't find a way to get the border around the button to dissapear so it ended up looking like my image had an extra black border around it. Then someone here suggested I just set the buttonMode property of an mx:Image to true which ended up working fine to a point. The problem I'm having is that even if I make the tabEnabled property of the image (that I'm using as a button) true, I can't tab over to it. Is there a way to either get rid of the black borders of a button or to make it so I can tab over to an image I'm using as a button?
    My second question has to do with image resizing. Lets say I have an image of a horizontal line that I want to put at the top of the mxml page, and I want it to extend the full length of the page, even after the user has resized the browser. Is there a way to do that? I've tried putting the width as 100% or giving the image a "left" and "right" value so that presumably it would be stretched to fit within those but nothing has worked so far. Is there no way to do this or am I doing something wrong?
    Thank you for any help you guys can give.

    Of course, sorry about that. So the following is a barebones example of how I currently implement buttons and images as buttons:
    <mx:Button id="facebookButton" icon="@Embed(source='image.png')" width="30"/>
    <mx:Image buttonMode="true" id="button" source="anotherimage.png" enabled="true" click="{foo()}"/>
    And within the image I've tried making the tabFocusEnabled property true but to no avail.
    The following is how I've tried stretching out an image across the whole page:
    <mx:Image source="yetanotherimage.png" width="100%" scaleContent="true"/>
    <mx:Image source="yetanotherimage.png" left="10" right="10" scaleContent="true"/>
    Is this more helpful?

  • Is there a way to add images , text and button in the individual marquee of a carousel

    Is there a way to add images , text and button in the individual marquee of a carousel ?

    Write a custom carousel.  Usually carousel components are just ULs that use something like jQuery to rotate through the LIs.  The foundation carousel component is really just designed for some specific use cases.  Generally I would just recommend rolling your own.

  • Actions menu wheel image and Go button image

    Hello ,
    In APEX 4 Interactive Reports, the actions menu wheel image and the go button are coming as html buttons instead of the wheel image and go button image.
    Is there a way I can rever to the old wheel img and go button .
    Thanks,
    Dippy

    Within the IR, under Search Bar, you can set Actions Menu Image to '/i/ws/action_32x24.gif' - this is the green wheel but does not have little arrow. I will contact our image guru and see if the old one is sitting somewhere. As for 'Go', this does not support an image but you can change the word if you need to (using Search Button Label) and set a button template to match your application.
    -- Sharon

  • I inserted a HTML5 video in page, when I test it in a Browser, I see the poster image and controls, But when I click play button the video goes white, slider moves like its playing, but just white picture. There was no audio included in video. Please help

    I inserted a HTML5 video in page, when I test it in a Browser, I see the poster image and controls, But when I click play button the video goes white, slider moves like its playing, but just white picture. There was no audio included in video. Please help

    Without a link, it's anybody's guess.
    It could be a problem the video rendering itself.  Which software did you use?
    Did you export to the 3 file types -- MP4, OGG and WEBM to support all browsers?
    Does your web server support those 3 MIME file types?
    Nancy O.

  • Deploying Images and Iconic buttons in forms 6i

    Deploying Images and Iconic buttons in forms 6I.
    This feature I am trying to use in Oracle Applications 11i.
    My environment is on HP Unix both database and web server.

    Hellow, i too have problems , to show icons in push buttons, in the browser, maybe you know how to migrate the toolbar to web.
    thanks you
    null

Maybe you are looking for

  • Itunes "Ignoreing" some of the MP3 files

    Afterthe latest issue of Itunes that i have slapped into my system a while ago, I realize that Itunes won't recognize some of the properly tagged, legally bought, or ripped mp3 files from my own collection. I am a year old Itunes and Vista user didn'

  • Can I upgrade my internal hard drive?

    I have a MacBook Pro 13-inch late 2011 and I would like to upgrade my hard drive on it. I think this hard drive works becuase it is 2.5 inches, but I just wanted to make sure that it would work. So, could you verify that this hard drive works, that'd

  • Getting list of view`s attributes names

    Hi experts, Is it possible to get list of attributes names on a view? After calling create_view(...) in controller I would like to iterate through all view`s attributes and fetch data from model for all attributes with the same name on view and model

  • Not a problem but a query. Firefox has just updated and is showing euballot-1.1 but no mention of GB. what is euballot? why is it showing?

    This is a query. Firefox automatically updated. When I look under update history it shows no update. Under Help clicked on about to see what version. Still showing 3.6.13 but no mention of en-GB. Instead has Mozilla Firefox EU euballot-1.1 What is eu

  • Asking for suggestions as a beginner

    Hey guys, I'm new to this fantastic dreamweaver world and I've just started building my website. As a beginner, I eagerly need suggestions from you who have much more experience in terms of web designing. Here is the question bothering me since the d