Changing images of toolbar buttons dynamicaly - uikit

I have a tool bar with buttons whose image is set to a particular image.When the user clicks a button in the main view, i want to change the image of one of the toolbar buttons to another image.I tried many methods.Everything ran without errors, but none showed any change in toolbar.Any suggestions?

There is a tutorial for this:
How-to-change-a-uibarbuttonitem-in-the-iphone-toolbar
This is a great tutorial because it goes over changing the images based on state as well.

Related

How to add an image by pressing a button in JavaFX

I want to be able to press a button and an image appear on the page.
Additionally, I want to be able to place the button with Y and X coordinates, not through layouts.
Would I need to use an image view?
Your question isn't very precise, so I hope I answer what you need.
To show an Image generally you need an ImageView, that is correct. For less common image formats you might need an external library.
To only show the image when the button is clicked, you have to first set the ImageView to not managed and not visible. Then when the button is clicked make it visible and managed and it will show.
About the absolute positioning of your button, you can override the layout children of any Parent object and set exact positions. Take a look at this question.

Content in table cell is not showing up

ich want to make an prototype app and added a table view where i want to put buttons and labels in.
It looks like this:
The problem is that when I run the app the button for example is not showing up. Does someone know why?
Still if I change the background a a single cell it's not showing.

How to make a button appear pressed in libGDX?

So I have an ImageButton that has a texture for when it's not clicked and another one for when it is.
I'd like to make it so that under certain circumstances it becomes disabled also appear as if it's clicked (displaying its "clicked" texture).
So far button.setDisabled(true) has worked wonders but it doesn't make the button appear clicked. I searched through the whole Scene2d ImageButton doc and couldn't find a single method that could do that for me. Any ideas how can I achieve it?
Try using ImageButtonStyle to set the drawables for the various states of the button. It also includes a drawable for the disabled state, which you can set to be the same drawable that you used for the checked state.
http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/ui/ImageButton.ImageButtonStyle.html

dojo Show/Hide One ContentPane While Another ContentPane Is Liquid

I've been struggling for weeks trying to crack this nut so I'm not sure if it's impossible, or if it's my lack of coding chops... or both. I'm not a programmer and I'm a newbie to Dojo Toolkit.
I have a site using the BorderContainer layout. I'm trying to create an effect where I can use a button to open and close a dropdown type box that will contain controls. I need this dropdown to be hidden on page load, and then open when you click the button.
My problem is that when I open the dropdown, it pushes the content pane below it off the bottom of the browser window. I need the lower ContentPane to stay fit within the remaining space of the browser window when the dropdown opens. Additionally, I want the dropdown to sit outside of the scrollable container for the content below it, which is why I have it set up to sit outside a nested BorderContainer below it.
I've created a simplified version of the code to demonstrate my challenge (see link below). If you load the page you can see the center ContentPane scrolls the content. But, if you then click on the button, a dropdown div expands above the content. Then when you scroll, you'll notice that you can't see the full pane because it's in no-man's-land below the bottom of the browser window. I assume that because the div is set to display:none on load, it's size is not accounted for on page load. Then, when you open it by pressing the button, it's size is additive and the pane below doesn't know how to resize or account for the new element.
I've tried using the visibility attribute, but that leaves a gap for the div when it's still closed. I've tinkered with some code that controls the height that shows promise, but each of my dropdown boxes will be different sizes so I'd prefer that the height be set to "auto" rather than a specified pixel size.
Does anyone have any idea how I can accomplish this so that the lower pane will fit in the space without pushing off the screen?
Here's a sample of the page:
http://equium.com/scaffold.html
(I had some problems trying to insert the full HTML page here as a code sample so if that's a preferable way to handle it, and someone can let me know the best way to embed all of that code, I'd appreciate it.)
Thanks is advance, I'd really apprecaite anyone's feedback.
You might want to take a look at dojox.layout.ExpandoPane (though be warned I think it has only worked properly for top and left regions for a while).
Also, I'd suggest simplifying/altering your layout a bit. See example here:
http://jsfiddle.net/taFzv/
(It'd probably need some tweaking to get exactly what you want.)
The real issue you're having is probably that the BorderContainer has no idea that parts of the view resized. ExpandoPane takes care of that by telling the BorderContainer to re-layout after its animation completes.
It works under IE8.0. When dropdown box open, just keep pressing mouse from page and drag to bottom, you could see the content was pushed to out of page. It looks the browser could not detect it and could not add it to "scroll bar" account.
I would suggest taking out all BorderContainers except your top level one, the one with mainPage as the id.
Place your {stuff here} div into the mainPage BorderContainer, after the ContentPane with the Close/Open button. Make sure you make it dojotype dijit.layout.ContentPane, set up layoutpriority, and set region to top. Set the height to 0/x when clicking the Open/Close button, instead of setting display.
Try your page again. If that doesn't fix it, you probably need, a call to layout, resize, or both to indicate to the BorderContainer that it needs to evaluate all its children and size the "center" pane properly. Something like dijit.byId("mainPage").layout(); Do this any time someone presses the Close/Open button, after you have changed the height of any BorderContainer children.
Maybe the dijit.form.DropDownButton would fit your needs. When click the button a tooltip is displayed that can be filled with any content you want. Just as you specified, the dropdown tooltip is only displayed when you click the button, and it doesn't mess with the underlying layout at all. The tooltip sits "on top" of the page.

How to keep list view control on top of other window?

I am working on a sample which contains list view to display list of names in the data base. Once the application is launched list view will be invisible. After clicking on some button I am making it to visible. If I make it to visible the control bellow the list view are also visible. And I have button bellow that control, once I hove on the list view the button also displays over the list view.
Please let me now how to solve this problem.
It sounds like you have child windows on top of each other in a dialog. Use ShowWindow(SW_HIDE) to hide the windows that are 'underneath'. So when you make the listview visible, hide the button that is underneath.
On the windows desktop, application windows will properly hide other windows that are underneath one another, but in a dialog, different styles are used, and you have to be careful not to let controls overlap or they can draw on top of each other. Instead you need to hide the ones that you don't want to be visible.

Resources