Scroll RecyclerView to show selected item on top

I’m looking for a way to scroll a RecyclerView to show the selected item on top. In a ListView I was able to do that by using scrollTo(x,y) and getting the top of the element that need to be centered. Something like: @Override public void onItemClick(View v, int pos){ mylistView.scrollTo(0, v.getTop()); } The problem is … Read more

How to disable scrolling in UITableView table when the content fits on the screen

I have a few (grouped style) tables in my iphone app (only on part of the screen and added with Interface Builder though, not subclassed from UITableViewController) that 80% of the time are small and will fit on the screen. When the table fits on the screen, I’d like to disable scrolling, to make it … Read more

Changing route doesn’t scroll to top in the new page

I’ve found some undesired, at least for me, behaviour when the route changes. In the step 11 of the tutorial http://angular.github.io/angular-phonecat/step-11/app/#/phones you can see the list of phones. If you scroll to the bottom and click on one of the latest, you can see that the scroll isn’t at top, instead is kind of in … Read more

How to scroll an HTML page to a given anchor

I’d like to make the browser to scroll the page to a given anchor, just by using JavaScript. I have specified a name or id attribute in my HTML code: <a name=”anchorName”>..</a> or <h1 id=”anchorName2″>..</h1> I’d like to get the same effect as you’d get by navigating to http://server.com/path#anchorName. The page should be scrolled so … Read more