I have added 4 RecyclerView inside NestedScrollView. One of them is Hidden, 2 are Horizontal, 1 is Vertical, as per requirement. All of them using Glide to load image but the Vertical one is not clearing/recycling image memory and all glide call makes at Same time.And memory goes to 200+MB because of it.
Here my XML:
<android.support.v4.widget.SwipeRefreshLayout
<android.support.v4.widget.NestedScrollView
<RecyclerView (Horizontal)
<RecyclerView (Horizontal)
<RecyclerView (Horizontal)
<RecyclerView (Vertical)
</android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
I have tried "nestedScrollingEnabled" false already, It worked fine with Horizontal recyclerview but not with vertical one. I am thankful for any Help.
I searched many stackoverflow links, tried some solutions, used OnRecycle method of recyclerview but didnt worked as i needed, Please help!
Related
I have implemented fusion chart (bar2d) type in my react native application. Its working fine, If the data is around 10-12 lines (graph lines) showing fine, But, If its 30 lines, Its getting shrink and adjusting the given height only.
Its not even enabling the scrollview (like flatlist), And the UI looks very inconsistent, Even, I tried to add the scrollview to Fusion Chart, But, Its not working. Because, The view is not getting expand, How to enable scroll, or according to data how to increase the view height.
Even, I contacted them regarding this issue, They told bar charts
don't have scrollview, Scroll contains only Vertical/Column charts.
But, My requirement is bar chart.
My output is following screenshot,
Actual, Which I am looking for is following screenshot.
And My code is
<View style={styles.container} />
<FusionCharts
type={type}
width={width}
height={height} // given 95%
dataFormat={dataFormat}
dataSource={dataSource} //dynamic json data which contains around 30 indexes
libraryPath={fusionChartPath}
/>
How can I achieve this?
Starting with following code
<Grid>
<ScrollViewer>
<ListView Name="listview" ItemsSource="{Binding Source={StaticResource list}}" />
</ScrollViewer>
</Grid>
I've huge list for winrt app around 1k items. it takes too much time to scroll so I've implemented scroll to top and bottom functionality.
listview.SelectedIndex
listview.UpdateLayout();
listview.ScrollIntoView(SelectedItem);
All this works fine on a simulator having around 1000 items in the ListView. but when I run the app with Surface device this method doesn't work. It actually fails and paints black rectangles while trying to render ListView.
I've just wasted my two days on it. I tried many things but no luck. Can someone tell me how can I handle long list using ScrollViewer having a ListView and using MVVM on Surface device itself. Simply put smooth scrolling on Surface device with a list of beyond 1000 while moving start to end programmatically.
PS: implementing search is not the option.
You should remove the outer ScrollViewer because that breaks virtualization. Other than that there's a limit on the size of the panels you can scroll to about 2 million pixels high/wide. After that you will see rendering issues.
The only way around that is rather complicated and involves writing your own list control from scratch. I don't think anyone has done it yet. Usually if the data is too big - people use other strategies like grouping and expanding groups.
I have a layout that looks somewhat like this:
<FrameLayout>
<Scrollview (empty view, set GONE)>
<LinearLayout (loading screen, set GONE)>
<CoordinatorLayout>
<AppBarLayout>
<RelativeLayout scroll|enterAlways|enterAlwaysCollapsed>
</AppBarLayout>
<RecyclerView with layout_behavior set>
<NestedScrollView (variation of empty layout, set GONE)>
</CoordinatorLayout>
</FrameLayout>
In the AppBarLayout there is a horizontal RecyclerView with cells, then below the main RecyclerView contains a different kind of cell and scrolls vertically. This works great when scrolling - the AppBarLayout appears and disappears perfectly.
The problem comes when searching and limiting results in the two RecyclerViews. When either RecyclerView is empty, it should disappear - and so when the top horizontal RecyclerView is empty the whole AppBarLayout should disappear.
To achieve this, I am calling AppBarLayout.setExpanded(false) - which is working. However, after calling that if I scroll the vertical RecyclerView up or down the AppBarLayout expands and shows itself. I've also tried resetting the LayoutParams scrollFlags so that they are 0, which should disable scrolling. The AppBarLayout no longer scrolls - but it still expands.
How can I totally prevent an AppBarLayout from expanding? I need to close it, and force it to stay closed until I reset it no matter what the user does.
In another place I had a scroll listener set up to expand the view at the top. This was triggering the expand where it should not have.
I am trying to initiate a scroll view in my UITextView and even though I seem to have selected the appropriate boxes, I can't seem to get the scrolling working. I have gone through multiple questions similar to this but none seem to have the answer.
I included an image of Xcode below:
Question 2: When I scroll down the majority of my text shows but the scrolling stops with two sentences or so left and I have to scroll down and hold it there to read. Any way I can fix this so it scrolls all the way to the bottom of the text?
Can you check the two boxes: Bounce Horizontally and Bounce Vertically and see what's happening? Sometimes your content are actually way bigger than your view, and they are touching a invisible outer box. If you can see they actually move, that means there is nothing wrong with touch or scroll, is just the view layout problem.
For the content issue, my guess is that the content size is not right, you can programmatically adjust it with textView.frame property, set it to a proper size, such as the frame of the window or the frame of the content, which are CGRect classes. Comment below to see if this can solve your second problem.
The text view will not scroll in storyboard, only the app. And the text view will scroll once the content in the text view exceeds the frame size.
If you're using iOS 7+, you can just turn on auto layout, pin each of the sides of the text view to the edge of its parent view, and it works fine without needing to do anything in code.
My problem is that I am using nested scrollviews. One for the horizontal paging and second to show the content with vertical scrolling (cuz content, which is text, is more than the available space). Actually there are multiple copies of this vertical scrollview like:
MainScrollView (Horizontal)
VerticalScrollView1
VerticalScrollView2
VerticalScrollView3
Besides these the vertical scrollviews contains label that are draggable, I implemented dragging using touchesBegan: and moved: events. I developed the whole thing using only one vertical scrollview and it's working just fine and I thought, to my dismay, that it'll work exactly the same for the rest but when I added more vertical scrollviews, only the last one is allowing dragging of the labels. The first two ain't allowing dragging, besides, they are also not responding to the vertical scrolling event, which was perfect earlier. I tried it with two vertical scrollviews and even then only the last one was allowing dragging. Ain't sure about the vertical scrolling cuz right now only the first one has enough content to be scrolled rest need not to. I can try that out too but it's kinda late here, so, if someone can guide me with the provided info. would be much helpful. Else I can try that out tomorrow and post you with the result.
Thanks for your time.
I had similar issues with nesting UIScrollviews. I found this video from WWDC 2010 to be really helpful in showing how to work with scrollviews inside a paging scrollview, and I managed to fix the bugs I had by following the steps in this video and looking at the sample code.
Designing Apps with Scroll Views
Sample code