Anyone with the latest beta, can you use the new symbol set that comes with iOS 13, e.g.:
i = ui.Image('lessthan.circle')
@pulbrich, others, any suggestions for a fuzzy search?
fuzzywuzzyis good, but I would like to avoid requiring an extra install.
difflib.get_close_matchesresults are highly unintuitive.
Is there something easy to use provided by iOS?
I would go with @TPO ‘s idea, perfectly enough for the purpose.
Usability is not 100% - for some reason
textfield.end_editing()does not hide the keyboard, at least on my phone.
@mikael Many, many thanks! Perfect now!
for some reason textfield.end_editing() does not hide the keyboard
Same on my iPad mini 4 (iOS 13 + Pythonista beta)
There is a kind of flicking, I think that the keyboard is dismissed and then comes back.
from ui import * from objc_util import * uiimage=ObjCClass('UIImage') v=Image.named('test:Lenna') u=uiimage.systemImageNamed_('lessthan.circle') v.objc_instance._setImageAsset_(u.imageAsset())
Leading underscore did the trick, iPadOS 13.1.3.
Maybe not the most future proof, but does the job...
@JonB As usual, you're the 🤴
@JonB, thanks. Intuitively this seems like it should be faster and more efficient than going via the PNG conversion.
But when I went to test the performance I ran into a couple of issues with the asset approach:
- Resulting image size is dependent on the size of the original ui.Image created.
- Both the original and ”asset-applied” images are retained in the ui.Image somehow, and for example ButtonItems do not really handle that well.
See below couple of example images. First one uses a too-large initializing picture (Lenna), the second too small one (triangle arrow icon), which you can see presented in the title area.