Listview:
I need to implement a listview that is horizontal instead of vertical.
Any example of this? Is it even possible?
I've try a scrollview, but it doesn't seems to be possible to dequeue cell. So it's very long to generate.
Thanks for your help.
You're going to want to use a UIScrollView with paging enabled. You'll have to roll your own queueing/dequeuing view implementation though. At most you should only need 3 views in your content view at a time. One to show the current item and the items to the left and the right.
try this component: https://github.com/Kastet/APCarouselView
Related
I have the following scroll view although when I run the simulator I am not able to scroll. I have vertical constraints set for the content items, any idea why this is?
can you provide your constraint details? i hope you have added one view on top of the scrollview.
I want to have two buttons side by side, and a BoxView, which will stand under the button which is pressed, therefore it must be able to slide from under one button, to another. I tried looking for that but cannot find anything related to Xamarin Forms position animation. How can I do that?
Any resources or advices on doing what I'm trying to do will be welcomed, thanks.
Use LayoutTo(position, duration, easing) method like:
yourBoxView.LayoutTo(new Rectangle(x,y,width,height),500,Easing.Linear)
I'm working with ScrollView component on my app. This ScrollView has some View containers in it.
What I'd like to achieve is to fire an event (for that specific View), or something when the View is visible on the screen, so I can know what View is visible to the user at that moment.
I hope this schema helps to understand it better:
In this case, the visible View is the one with ref="2" so I'd like to fire something like event(2). And when you keep scrolling and View ref="3" is visible, fire event(3).
I don't know if this is possible to achieve, so I'd like your help :)
It's not currently possible. But peeking through https://github.com/facebook/react-native/search?utf8=%E2%9C%93&q=scrolly&type=Code we can see that at least in android the emitted scroll event has a scrollY value. So it may be possible someday.
https://github.com/facebook/react-native/blob/03d7c7a6a1257d15c26e61cd660fb57222b5b969/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java#L43
I have a listview that contains a horizontal scrollView inside each row.
Now when getView() is called for each position in the listView, I am creating and adding views (relative layouts) to the horizontal scrollView. This getView() is pretty cramped.
I am trying to improve the performance of my listview.
I do not store each of the views inside my horizontal scrollView for each position in list view as that would amount to storing all the views that go into the whole listView. This i wouldn't be taking advantage of view re-use feature.
But then how do i improve the performance as I am having to create the views inside the horizontal scrollView every time get view is called and that itself is quite heavy.
If i store these internal views (relative layouts) in a map (position, list of views) and then in get view just call that position get all the internal views and feed to my horizontal scroll view?
I am confused about this. could someone please help me in improving the performance here.
Thanks.
Sunny
The main concept of Listview is to reuse the child components.
Basically, what you are doing could be wrong. HorizontalScrollview consumes a lot more memory than ListView, and I'm assuming that the getView() method is doing a lot of work.
My Suggestion:
Listview should be replaced with ScrollView and HorizontalScrollView should be replaced with ViewPager or HorizontalListView.
Note: If you want a perfect answer post a screenshot
I would like to create an infinite scrollView (like a slot machine), but without paging. When the user scrolls down, it's easy i just have to increase the contentSize and the scrollView scroll endlessly :
- (void)scrollViewDidScroll:(UIScrollView *)theScrollView {
theScrollView.contentSize = CGSizeMake(45, theScrollView.contentSize.height+45);
}
But how can i create the same effect when the user scrolls upward ? I tried to play with the contentInset but then the contentOfsset doesn't get updated and i end up having weird behaviour.
Do you have any idea how i could achieve that ?
I needed the same, so I created this: http://dev.doukasd.com/2011/04/infinite-scrolling-dial-control-for-ios/
Have a look at the video, I believe it's what you're looking for. Source code is included.
I have developed this kind scroll view. It can scroll infinite.
You can check on github: https://github.com/quangrubify/InfiniteUITableView
I think you should give us more details about the issue. What content do you want the user to see when he is scrolling upwards? You increase the contentSize in scrollViewDidScroll method, but you are not checking the contentOffset, so the contentWill be bigger whenever the user scrolls the scrollView (either way, even horizontal if allowed). Since the contentOffset is already at 0, the user cant scroll upwards because there is nothing that the scroll view can show.
I dont know the content of your scrollView, but I have implemented infinite scrolling horizontally. For details, see: https://stackoverflow.com/a/12856174/936957
PS: Do not use "magic numbers", this is a better alternative:
theScrollView.contentSize = CGSizeMake(theScrollView.contentSize.x, theScrollView.contentSize.height+45);
//Or theScrollView.frame.size.width alternatively