title: Programmatically set gravity to vertically center content of HorizontalScrollView
body: <p>I have a HorizontalScrollView containing a LinearLayout. I can't seem to get the content to vertically center inside my scrollview, I can't set gravity on the horizontalscrollview, even though I tried with a LinearLayout.LayoutParams when setting the scrollview as contentview.</p>
  
  <p>Can anyone help?</p>
  
  <p>This is what I have:</p>
  
  <p><code>HorizontalScrollView sv = new HorizontalScrollView(c);</code></p>
  
  <p><code>LinearLayout llh = new LinearLayout(c);</code>
  <code>llh.setOrientation(LinearLayout.HORIZONTAL);</code></p>
  
  <p><code>sv.addView(llh, llh_lp)</code></p>
  
  <p>llh_lp is just simple wrap_content params.</p>
  
  <p><code>setContentView(sv)</code></p>
  
  <p>And I tried adding linearlayout.layoutparams with gravity = gravity.center_vertical too, on the setContentView call.</p>