I'm working in a mobile app for iPad in Flex 4, I have a list with custom items rendered, data is taken from external XML. In that XML I get an image path, so when I scroll down, the images go out...
Is there a way to prevent the list of items from getting destroyed upon scroll down?
Yes, I believe the feature you are talking about is item renderer recycling.
For performance reasons I don't recommend turning this off but if you have to you can set
useVirtualLayout="false" on your list
Set your list useVirtualLayout property to false. But beware of performance issues !
See :
http://flexponential.com/2010/01/10/caching-images-loaded-from-a-spark-item-renderer/
Related
My Ionic1 app displays a list of items that can be collapsed/expanded, so the vertical length of the content can increase significantly when an element is expanded (the way I do it is through ng-show directives).
My issue is that when this happens, I cannot scroll down to see the new content. Actually, if I drag my finger from bottom to top, I can see the new content appear in the bottom, but as soon as I release my finger, some elasticity brings back the top of the content.
However, strangely enough, after a few seconds, the scrolling mechanics is updated correctly and I can scroll normally.
It looks like the Ionic framework takes some time to figure out that the content length has changed and needs some update in the scrolling mechanics... I would like to tell him immediately once it is needed. I tried to call $apply from the onClick call back of the Expand buttons, but I get an error saying I am already in a digest cycle.
Any clue to fix this please? Many thanks!
You can avoid $apply approach because every $scope.$apply is rebind in the page. So you can follow the ionic scroll concept.
ionic scroll
Thanks! this helped me fix the problem, by adding a call to $ionicScrollDelegate.resize() whenever some item is collapsed/expanded.
You can check the issue with this fiddle: quickly expand groups 7/8/9 and try to scroll down:
http://jsfiddle.net/shengoo/6b0y3tar/
I want to load more data when user scroll to bottom of LongListSelector or ScrollViewer (contain longlistselector).
I have search some stackoverflow question but it's not solve my problem
Here is a good post about Detecting **LongListSelector’s scrolling to the bottom. You can have Reference from here Detecting WP8 LongListSelector’s end of scroll (stretching)
Try this Implementation for calling calss function:
var _list_compress = new WP8PullDetector()
_list_compress.Bind(LongListSelectorName);
_list_compress.Compression += _list_compress_Compression;
I am using Daniel Vauchan solution with ScrollViewerMonitor from this blog post: http://danielvaughan.org/post/Scroll-Based-Data-Loading-in-Windows-Phone-7.aspx
Where is also sample code availiable http://danielvaughan.org/file.axd?file=2011%2f1%2fDanielVaughan.ScrollViewerMonitor.zip
It was developed for ListBox in WP7, but still works fine with LongListSelector in WP8. Just be careful with scenarios which involve Navigation between pages, because this code uses DependencyPropertyListener class and subscribes to listener.Changed event every time your LongListSelector will be Loaded. So you have to manually detach listener.Changed when Navigating from your page.
As an alternative you can try to use Telerik RadDataBoundListBox. It's rather good and supports Infinite loading from the box.
UPDATE:
It seems, that LongListSelector doesn't contain ScrollViewer. ScrollViewer is inside Listbox. However there is ScrollBar inside LongListSelector and its Value Property and ValueChanged event. You can detect scrolling to bottom with scrollbar valuechanged event with checking that ScrollBar Value is more or equals ScrollBar.Maximum. (You can add some constant to improve scroll to end detection).
Have a look a this link from Windows Phone Blog. I haven't tried it personally but have bookmarked it for future. Let me know if it is useful.
How to create an infinite scrollable list with LongListSelector
I have been googling this for a while and can't find any solution... I am wondering if it is possible to keep a navigation menu in the browser cache eventhough there is an active element that changes from on page to the other (highlighted menu item when on it's page). I m pretty sure browser cache menus to avoid the user to always download the same menu but it doesn4t seem to work on the website I am working on : http://2degreesproject.com.au/Connection
Thanks for you help !
You could consider loading all your other content with ajax. That way you never have to reload the menu. Otherwise, you'll need to pass a bit of information from one page to the next using your server side language or an ajax post. You could always set a cookie and change the value of it on each page to keep track of what the last page was. That's probably the standard way of doing this. Look into how to set cookies, and how to change their values (usually you just unset and reset with a different value, I believe).
How can I let the user reorder the rows of a list in a flex mobile app?
You know, you see it a lot in native iOS apps. Usually you hit an Edit button at the top of a list view. Each row then gets a thumb icon that lets you move the rows around in the list.
This might be totally obvious, but I'm writing my first mobile app in flex and can't seem to find an example anywhere.
Cheers.
Spark List control supports Drag and Drop, besides dragging and dropping with the list itself, you can also do so between two different list controls. To enable the feature, you could set dragEnabled, dragMoveEnabled, dropEnabled properties to true, more details may be found in this help document.
To enable the feature as you described, you could set those drag and drop properties to true when the edit mode is enabled. Optionally, you could also display a drag handler (as decorator).
Update: For mobile application, there is a write-up on how to get around with mobile limitation of drag-and-drop.
http://java.sun.com/products/jfc/tsc/articles/mixing/index.html advices how to make JPopupMenus heavyweight. Just set the property:
setLightWeightPopupEnabled(false);
It works fine, but if I have submenus in the popup, implemented as JMenu items, they don't seem to inherit the popup's heavy weight. JMenu doesn't have a method to make itself heavyweight, and using an AWT Menu isn't an option, since I want to put Swing items into it.
How do I make the submenus heavyweight, too?
It seems to be a Swing bug. Setting the global property
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
works! Also submenu JMenu items go heavy, as they should. Obviously the per-instance method setLightWeightPopupEnabled should work similarly, but it doesn't.
I filed a bug (Bug Id: 7005406) on this, but I leave the question here just in case that someone else bumps on this. So the solution is to use the global setting until the bug gets fixed.