I am looking for a behavior very similar to ios where we can scroll horizontally to see multiple pages (like a walkthrough/demo). In ios we can do it with UIScrollView and PageControl but not sure how can that be done in Android?
I don't mind if it's not possible to add the bullets of PageControl. I am more concerned about the pages type behavior of scrollview.
Take a look at this article on viewPager, I think it has the something as you require.
http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
You can use ViewFlipper in android to scroll or swipe between the different layouts....
Try searching "android ViewFlipper onFling()" on google..
http://www.codeshogun.com/blog/tag/view-flipper/
Related
I want to create a scroll view with pages that can be scrolled vertically and horizontally as well.
The scroller should be just like a slideshow on a website, to slide between images (content). Something like ScrollView, but to stop at a certain point when scrolled.
I am using this in Xamarin.Forms, so I'll need to create a custom renderer (Android) and set the content of the pages from Forms.
I tried ViewPagers, but I want to be able to set the content from Forms page, not from predefined layouts...
I just couldn't find a clear example/tutorial so I can understand how to approach this problem. I also think about overriding some methods from ScrollViewRenderer class, to intercept and only slide to a certain point, but have no idea which methods and properties to change.
Something like CarouselPage on XF, which can be used inside a layout.
Any help or examples would really be appreciated. Thanks!
I'm searching for 2 days for a solution for this problem.
I am trying to implement a vertical listview with horizontal scroll on each item just like the facebook newsfeed. Suggested apps can be seen by scrolling to right and some part of next item is also visible.
here is the screenshot :
http://i.stack.imgur.com/7JRfM.png
So I am just stuck here and don't know how to proceed.
You're probably going to need to write some custom code (which is a pretty good rule of thumb whenever you're trying to do something Facebook did on Android; they do some crazy stuff).
I don't believe you can nest ListViews in Android. There is "ExpandableListView", which lets you expand items to show more, although this isn't quite the same thing.
I would advise to just create a vertical ListView, and have the items be horizontal LinearLayouts that you can inflate yourself. You can also try making them horizontal ScrollViews (although I think this may have the same limitation as using nested ListViews).
Good luck!
Let me start by saying - I know there are quite a lot of posts on this issue. I've been digging and testing it quite a bit, but couldn't come up with the proper solution to my specific requirements.
I need to have a master view with several webviews inside it, and more than one should be visible at a single moment. For this master view - I need to be able to scroll it (to reveal invisible webviews) and to zoom (in order to focus on a single webview).
I've tried TableLayout, but had problems with the zoom (and painting issues with the scrolling). I've tried scroll views, but also read it's not recommended.
Any ideas or recommendation regarding how to achieve this?
Thanks,
yakobom
A simple approach could be to have only one webview with the root html doc containing multiple iframes. Load each page in one of the iframes.
This way the scrolling/zooming could be handled by the webview itself.
Scrollable view can be achieved by adding a scroll view in .xml file and placing remaining text views, edit texts in that scroll view..
to scrolling webview:
mWebView2.getSettings().setJavaScriptEnabled(true);
mWebView2.getSettings().setLoadWithOverviewMode(true);
mWebView2.getSettings().setUseWideViewPort(true);
mWebView2.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
mWebView2.setScrollbarFadingEnabled(true);
to zooming webview:
webView.setInitialScale(50);
webPlanSettings.setDefaultZoom(WebSettings.ZoomDensity.FAR);
webPlanSettings.setUseWideViewPort(true);
Suppose I have a list of data to be displayed. I know how to display it using a ListView And it is very simple and easy to do it that way. But I am looking for an alternative way to achieve the same. I don't expect to have more than 20 items in the data set I am planning for.
I was thinking of a number of squares that the user can swipe to see the next one etc, similar to some widgets on home screen.
I came across android.widget.StackView, any advice available for this?
You can try StackView (http://developer.android.com/reference/android/widget/StackView.html).
This is how the Gallery and Youtube widgets are rendered.
ListView is the best option for listing lots of data. It has very efficient loading property. But if you do not want it any specific reason, you have to use ScrollView and in ScrollView, you have to place a LinearLayout and in that LinearLayout, you have to place multiple LinearLayout(for each items of data).
Maybe you can use a ViewPager (available also for lower versions of SDK through compatibility pack).
http://developer.android.com/training/implementing-navigation/lateral.html - see also the project example top right of the page : EffectiveNavigation.zip
You can use a GridView, if you want to show multiple items on a page in a different fashion than in ListView.
You can also use ViewPager (from android 3.0, or with the support library) with your custom views.
I have several HTML pages that I'd like to be able to scroll horizontally, kind of like how you would read a book or a magazine. But instead of a totally smooth scrolling horizontally, I would like each page to kind of click into place as I scroll.
What is the best way I can go about doing this?
Maybe use a ViewFlipper with multipe WebViews and add animations when you flipp through your views.
Also you would have to add a GestureDetector and implement the onFling() method.
Depending on how many webpages you have you might want to limit the amount of WebView instances and resuse them and just load another page when they are shown.