title: Automatically scroll to bottom of RecyclerView
body: <p>I have a fragment that has a RecyclerView inside its layout file. The RecyclerView holds messages in a chat. So naturally, I need the RecyclerView to scroll to the bottom when the chat fragment gets opened. </p>
  
  <p>I tried scrolling directly on the RecyclerView:</p>
  
  <pre><code>var mRecyclerView = view.FindViewById&lt;RecyclerView&gt;
  mRecyclerView.ScrollToPosition(mMessages.Count-1);
  </code></pre>
  
  <p>Second method:</p>
  
  <pre><code>LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(Application.Context);
  mRecyclerView.SetLayoutManager(mLinearLayoutManager);
  mLinearLayoutManager.ScrollToPosition(mMessages.Count - 1);      
  </code></pre>
  
  <p>Third method:</p>
  
  <pre><code>LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(Application.Context);
  mRecyclerView.SetLayoutManager(mLinearLayoutManager);
  mLinearLayoutManager.ScrollToPositionWithOffset(mMessages.Count - 1, 0);
  </code></pre>
  
  <p>Unfortunately, nothing happens in either case. Any suggestions would be greatly appreciated!      </p>