ListView item value change when I swip screen..Unity - unity3d

I am new in unity. I create a project in unity where I bind some items in listview and in one item I use two different images and change on click the item. It's works fine..But when I go to other tab(or browser) and come back to unity then the item will change on it's default state..
Default state of image
Changing state of image

Not sure how you to implement the tabs switch.
An easy way to keep the button status is using PlayerPrefs
// before click other tab
PlayerPrefs.SetInt("BtnStatus", someitem.status);
// after come back
someitem.status = PlayerPrefs.GetInt("BtnStatus", 0);

Related

DropDown menu on value change doesn't work after load scene

So the dropdown menu on value change is no longer working after loading to new scene, google for a very long time. Resetting the input, and event system. Still no luck.

Unity UI Resume Game button is unclickable

So i have been trying to create a pause menu for my project, however the resume button is un-clickable (the same i believe for another button on this menu). The event system does not show anything when hovering over this button or attempting to click it.
Screenshot of Event System not showing button object
The button itself is set to interact-able and has the button's image as it's target graphic. The canvas it is also placed on also has the Graphic Ray-caster component attached. I also do not believe that there is any UI object covering the button preventing it from being clicked.Screenshot of Pause Menu UI as seen from scene view to show no blocking objects I am making use of the first person character controller starter asset by unity as well as the new input system.
I am unsure as to what could be causing this, I have also tried locking the cursor of the starter asset inputs.
Any advice would be greatly appreciated.

How to resize component in a specific state Adobe XD

I want to have this component's size to only encapsulate the info button not the whole area. Is there a way to have a component have different sizes depending on components state.
Right now when i hover over that entire green area it changes to hover state, i want it to only activate when the "i" is hovered
If you choose the component state and go to the left menu you can hide layer you dont want
I know this is an old post but hopefully this helps someone. This same problem was driving me insane! But there is a simple solution:
Rather than using the default "Hover State" in the component create a "New State" which will function as your hover state and name it whatever you like and design the default and new states. Then, go to the Prototype tab, select the icon you want to trigger the hover animation, then add a new Interaction on the right panel. Set the Trigger to Hover, and the Destination to your new state. Works perfectly, and now you will only trigger the hover animation when hover over your icon rather than the entire component area.

How to get ecm.widget.viewer.ContentViewer items

I have a page where first half (vertical) of the page has a gridx and second half of the page has a contentViewer. When a user clicks on an item from the grid, I'm loading the respective image and is working fine. When the user clicks on the second item from grid, the viewer is loading the second image but the issue is it is retaining the first image as well (images are opened as a tab). So I need to remove the first image when loading the second image. Is there a way to get items from ContentViewer so that I can close the previous one before loading the new one?
The getViewersStatus() method of ContentViewer will return to you a structure that includes all the currently open items. You can then iterate through this and call closeItem() on each one.
But if you are using Navigator 2.0.3.3 or later, what you probably want to do is call closeAllViewers() on the ContentViewer widget to close all open items without prompt to save changes.
Ref: https://www.ibm.com/support/knowledgecenter/en/SSEUEX_2.0.3/com.ibm.developingeuc.doc/doc/JavaScriptdoc/symbols/ecm.widget.viewer.ContentViewer.html
Ok here is what I did to achieve this.
if(this.imgViewer.mainTabContainer.getChildren().length>0){
array.forEach(this.imgViewer.mainTabContainer.getChildren(),function(child){
this.imgViewer.mainTabContainer.removeChild(child);
});
}

Unity new UI button click able outside of button area, non clickable over button area

I have created new UI button in empty scene,
Whenever I click on button its not click-able , but when I take cursor slightly above the button area and click, it gets clicked.
I guess Something like offset problem occurring?? Any fix to that?
NOTE I have tried creating new scene same result
,also created new project though Same result.
Did you check the EventSystem gameObject, it displays which UI element you are hovering, and other useful information.
After lot of trial and errors, reinstalling Unity did the job