Currently, I am having a ListView
with different list item view for each row (Most cases Different). I am having 6 different item layout, I will add more in future, and I will have only like 5-15 list items, some time may be less and may be many in other cases.
Some item views contains:
As this is dynamically generated depends on data, I am facing following issues :
Is RecyclerView
the best solution in this case?
Without seeing your code to identify specific concerns, it's hard to address specific reasons why you are seeing such performance problems. Such as, are you properly using the ViewHolder paradigm? Or are you inappropriately loading stuff on the UI thread when it should be loaded on a background thread? Android has a small section talking about scrolling smoothly with a ListView you should check out. That aside,based on what you have mentioned so far...I think you major problem is design.
Problems
If your ViewPager
is using a FragmentPagerAdapter
...then that will definitely be causing a lot of overhead and performance drag.
ListView
: You should never ever place a ListView
within another ListView
. This will cause all sorts of problems. Android does not like embedding two scrollable widgets that scroll the same direction. Even if this worked, it'll cause some major performance problems.
GridView
: Same goes with the GridView
. You should never ever place a GridView
within another ListView
. Even if this worked, it'll cause some major performance problems.
If you're ImageView
is loading some large graphics, it should be on a background thread and not the UI thread. Else you'll get some slow performance
Carousel - I have no idea what API this is but if it scrolls vertically, then it's a no go.
WebViews
are a very heavy weight object. I can definitely see this guy slowing things down, especially if it's loading a lot of content.
To build off what @Joffrey has said. There are some major concerns in your choice of UI. Based on what you are placing in this ListView
tells me that you need to seriously rethink how to display your content to the user. Eg, try using a TableLayout
or GridLayout
instead of a GridView
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.