Custom PickerView froze up (With sample project) - iphone

Background: I have been wanting a PickerView that is exactly matches that of Safari. I looked through many Gits and found none that work quite as exactly. I decided to build my own. It is complete now, but there is a bug that would not go away.
Problem: If you run the sample project you will be greeted with 2 text fields.
Tap on one of the textfields - it brings up the BTPickerView. Everything works just as you would expect.
Choose the fourth choice, then press done.
Tap on the same textfield. This time, the debug log will show you that you have executed an infinite loop, which freezes the app.
Question: What did I do to cause it? And how do I fix it?
I have tried everything to boil it down. It comes down to this and I could not go any further. Please advise.
Edit: Here is the sample code you can download in case anyone missed the blue link above.

The issue seems to be with the constraints in BTPickerLabel. If you temporarily disable the constraints from BTPickerLabel, code works fine. Enforcing constraint might trigger the reloading of entire picker view infinitely. I hope it should help you to fix the problem.

Related

Mouse is offset only in one particular GUI in Unity

I have 3 different GUI containers/sections, one for showing resources, one for building, and one for inventory. Clicking anything in the resource and building sections works completely fine, the mouse is where it needs to be and clicking/hovering over a button will actually click/hover over the button.
The problem is only in the inventory GUI. I'm not sure how it's any different, so I don't know what I need to provide here for anyone to help me out, so please ask me for any extra info if you need it in the comments. I'm not sure if this is an issue with the code or the UI elements, or whatever else it might be. I'm going to provide some examples of this happening, though.
Here is a gif of what it looks like in the inventory (ignore the items not doing what they are supposed to): https://s3.gifyu.com/images/ezgif.com-gif-maker-37b00e5b2a1c164b2.gif
Here is a gift of me just hovering/clicking around in the inventory: https://s3.gifyu.com/images/ezgif.com-gif-maker97b27b8783d784c6.gif
Here is a gif of this working in the "Building" section: https://s9.gifyu.com/images/ezgif.com-gif-maker-287d7a9723f9db2b1.gif
Here is a gif of this working in the "Resources" section: https://s3.gifyu.com/images/ezgif.com-gif-maker-18662e4229ebd27a2.gif
Here are some images that might be useful. Here is the layout:
There is no difference when I select, for example, Building and Inventory. Here is a comparison:
I have looked around on Google for about 30 minutes, but I couldn't find anything related to this.
I have found the issue. The issue was with the slot prefab that was in the inventory screen, as it had text that was way bigger than it was: https://prnt.sc/uDRXz2Kr4kQr
I initially hadn't noticed this as simply clicking on the prefab itself shows that it's the right size: https://prnt.sc/BXQqAzMD-kWX
Resizing the text seems to fix the issue.

Progress bar (b-progress-bar) not animating

I added a simple b-progress-bar to my code in order to show some percentages. I followed the official documentation step by step, and everything is showing nicely, except for the animation part. Here is the component html:
<b-progress max="100" :animated="true" :striped="true" show-progress>
<b-progress-bar :value="balance" variant="danger"
:label-html="(balance/100) * 100 + '%'" />
</b-progress>
When the component displays, it doesn't move, stripes are there alongside everything else, but the animation is missing. Another thing I noted is that even the progress bar in the documentation isn't being animated for me. Could it be a browser problem?
Thanks in advance.
If anyone stumbles upon such a dumb issue, please check your Windows/Browser settings to see whether you have disabled animations.
I personally disabled animation on my whole PC to speed it up, and that was blocking the from doing anything visual.

Plotly Dash - Callback triggers sometimes & the same callback doesnt trigger sometime

I am facing issue with callbacks. I have 3 drop downs, one scattermap , one table and one slider on the screen and they all need to work in tandem and i have 5 call backs. When i execute the application all my callbacks associated with these controls execute in random order. After that when i click on scattermap it may or may not work. Say we assume it worked. Then i can navigate all around without any hassle. Then if i execute the application then click on the scattermap then as i mentioned it may or may not work. Say suppose it didn't work this time. If so is the case it will not work at all no matter what i do and simulaneously one specific dropdown also becomes dysfunctional. However if click any of the other two drop downs then evrything will start functioning as normal.
I have digged really deep into this and figured out that this has nothing to do with my code. The underlying issue is that when the click doesn't work the reason the reason behind that is the callback isn't getting triggered. I found out this by applying some debugging techniques and i am 100% sure the callback is not firing. Can anyone help me resolve/understand this please.

JavaFX TableColumns' headers not aligned with cells due to vertical scrollbar

after having spent the last few hours searching the web for this issue I decided that I need your help.
The issue is similar to this topic: Javafx: Tableview header is not aligned with rows
No answer has been provided there and also, I think, my case is slightly different:
I have a properly setup TableView with reused CellFactories and CellValueFactories. Data-wise, everything works 100% the way I intended. However once I populated my table with more rows than my view can show it naturally started to show a vertical scrollbar. From that moment on (see first screenshot) the column headers weren't aligned with the columns anymore. It appears that it is exactly the width of the scrollbar that distorted the widths distribution (I'm using ConstraintResizePolicy with a few fixed width columns and the rest relying on computed width, again, otherwise working flawlessly).
As soon as I scroll with the mouse wheel, click on an entry, tab into focus or resize the window/view, the headers snap into place (see second screenshot).
Based on the topic posted in the beginning, I think this is a bug and I'm therefore not only looking for a solution (which might not exist) but also for a workaround. I tried:
table.scrollTo()
table.scrollToColumnIndex()
table.layout()
table.requestFocus()
table.requestLayout()
table.refresh()
I know not all of those make sense but still I tried and none of them made the column headers be in line with their columns on application launch.
Every suggestion is welcomed.
I don't feel that sharing code helps here, but ask if you want something specific. The view was built with SceneBuilder 8 and consists of an AnchorPane, a TableView in the middle, and 6 TableColumns, nothing else.
Thank you very much!
I've had the same problem. It seems a bug. Try this. It works for me
Platform.runLater(() -> tableView.refresh());
I know this is an old message but I tried everything to get the headers aligned and nothing was working until I stepped away from the problem. I then tried this and it worked. Headers jump but I am ok with that. I hope this helps someone else.
Task<Boolean> task = new Task<Boolean>() {
#Override protected Boolean call() throws Exception {
Thread.sleep(300) // needs this to make sure the table is displayed
table.refresh();
table.scrollTo(0);
return true;
}
};
new Thread(task).start();
I also have the situation of TableColumns' Headers not aligend with cells.But I am not because Scrollbar.I am because of setting a border color for cells.After the CSS modified, I got the correct result.
Incorrect CSS:
.table-row-cell {
-fx-border-color: black;
}
changed to:
.table-row-cell {
-fx-table-cell-border-color: black;
}
Reference documentation: https://community.oracle.com/tech/developers/discussion/2505963/tableview-column-headers-do-not-line-up-with-rows
None of the other solutions worked for me. I noticed that the issue only occurs when the horizontal scrollbar is on the far right and then the table is cleared (table.getItems().clear()) while other content changes didn't cause the bug even if the scrollbar disappears and reappears.
I checked this bug report https://bugs.openjdk.java.net/browse/JDK-8149615 (and the linked changeset) and at first dismissed the workaround because scrolling to the first column (table.scrollToColumnIndex(0)) wasn't working for me either.
But it started working once I called scrollToColumnIndex before clearing the table with getItems().clear().
The bug report suggests reacting to the visibility change of the placeholder node. I didn't test this because I had already solved it (hopefully) and no sample code is provided. But if I ever need to revisit this I would try writing a listener for the placeholder visibility as an alternative solution.

UISearchBar error when entering Searchbar textbox

I have found a strange error. I have been following this sample:
http://jduff.github.com/2010/03/09/throwing-a-uinavigationcontroller-uitabbarcontroller-and-uisearchbar-together/
I tested it and then tried to roll it in my app. It worked in the sample but not my app. In my app I would SIGABRT or BAD_ACCESS errors whenever I entered the textview inside the searchbar. The main difference was that I placed the Search on the second tab rather than the first. When I changed the taborder on my app to have the search on the first tab's navigation controller, it worked! It seems that unless I first enter the searchbar's textview. The object gets released and if I try to enter it later it fails. Very weird. I don't know enough about the objects here to say what the initialization sequence is but my guess is I need to do more initialization to get it to work.
go through the article in the link once more. especially through the "Setting up the Project" part.
In the article everything is set for the "selected view controller" which is the first one. And you say you implement everything to the second tab. Make sure you didn't implement everything in the first one of your project.
Let me know if this helps. If not I'll figure out something else.